Commit Graph

604 Commits

Author SHA1 Message Date
Kalle Sommer Nielsen
607b7d662a Added missing zend_parse_parameters_none() to restore_error_handler() and restore_exception_handler() (Ferenc) 2015-03-30 17:57:32 +02:00
Kalle Sommer Nielsen
10e1b13ac5 Minor cosmetics for our test functions in the debug build 2015-03-26 02:03:55 +01:00
Kalle Sommer Nielsen
67b907f059 Change the error message for colliding class/interface/trait names to be a little more clearer.
C:\> php -r "interface stdClass { }"
  Error: Cannot declare interface stdClass, because the name is already in use in Command Line Code on line 1
2015-03-26 01:44:23 +01:00
Kalle Sommer Nielsen
927d53fda4 Change "Cannot redeclare class X" into "Cannot redeclare class/interface/trait X", meaning that the following:
C:\> php -r "trait A { } trait A { }"

Will now properly print "Cannot redeclare trait A" instead of "Cannot redeclare class A" to make error messages a tiny bit clearer. Admittedly, a better solution can most likely be made by actually telling what the colliding object is a type of.

Internally this adds a new function:
 zend_get_object_type()
2015-03-25 06:31:11 +01:00
Dmitry Stogov
8633685675 Use specialized macro for string zval creation 2015-03-12 16:53:51 +03:00
Dmitry Stogov
c2c78dc963 Added specialized versions of DO_FCALL handler:
DO_ICALL - for internal functions
  DO_UCALL - for user functions
  DO_FCALL_BY_NAME - plain, most probably user, funcstions (not methods)
2015-02-25 10:37:21 +03:00
Dmitry Stogov
5f76eed14e don't count op_arrays stored in opcache SHM 2015-02-20 14:59:30 +03:00
Dmitry Stogov
e10e151e9b Merged zend_array and HashTable into the single data structure.
Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
2015-02-13 22:20:39 +03:00
Nikita Popov
2fb85f1058 Cleanup checks in zend_builtin_functions.c
The EXPLICIT_ABSTRACT_CLASS comparisons are no longer necessary.
2015-02-12 23:31:01 +01:00
Guilherme Blanco
8c81d80e10 Made ZEND_ACC_TRAIT a saner value
CC_TRAIT valued as 0x120 is too magical to be comprehensible by others.
2015-02-12 23:20:19 +01:00
Reeze Xia
2c84006f5a Add test function arguments 2015-02-05 01:21:42 +08:00
Xinchen Hui
16732dedfe Fixed refcount handling in get_class_vars() 2015-01-23 13:32:07 +08:00
Dmitry Stogov
faf917d94e define() must not modify the source array 2015-01-22 15:49:38 +03:00
Dmitry Stogov
8dc3c283b8 cleanup 2015-01-20 08:55:36 +03:00
Xinchen Hui
442efdaaea Optimized is_a 2015-01-19 09:10:01 -05:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Dmitry Stogov
58efbf0a92 Fixed possible double free 2015-01-13 11:32:36 +03:00
Dmitry Stogov
d810cf816b Fixed possible crash 2015-01-13 08:30:54 +03:00
Dmitry Stogov
916d5ece39 Optimized error_reporting() similar to silence operator (ZEND_BEGIN_SILENCE opcode). 2015-01-12 23:50:03 +03:00
Dmitry Stogov
c5047d1f11 Use FAST_ZPP in few more frequently used functions 2015-01-12 19:26:12 +03:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Nikita Popov
2d212b426a Drop duplicate arg from hash_get_current_key_ex 2014-12-26 21:06:18 +01:00
Anatol Belski
86af370b81 remove unused variable 2014-12-24 14:14:29 +01:00
Anatol Belski
385bda6cdf C89 compat 2014-12-24 14:14:28 +01:00
Dmitry Stogov
c42ac09518 Added new API function 'zend_string* zend_string_tolower(zend_string*)'.
It simplifies code and avoids unnecessary allocation and copying if string is already in lower case.
2014-12-24 15:04:51 +03:00
Dmitry Stogov
106b1017d4 API for fast construction of packed arrays 2014-12-23 19:08:28 +03:00
Dmitry Stogov
f3506dfacb Improved get_object_vars() 2014-12-23 02:49:47 +03:00
Dmitry Stogov
2646f7bcb9 Don't count variadic argument in zend_func.common.num_args. This allows faster CALL/RETURN code. 2014-12-22 16:44:39 +03:00
Dmitry Stogov
0833fd4619 Allow arrays with define(), to match const syntax support 2014-12-21 03:03:49 +00:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Dmitry Stogov
dcfe58773e Rename EX_VAR_2() into ZEND_CALL_VAR() and EX_VAR_NUM_2() into ZEND_CALL_VAR_NUM(). 2014-11-28 11:11:33 +03:00
Dmitry Stogov
1da14c9f81 Pack EX(frame_info) into EX(This).u1.v.reserved. Rename "frame"kind" into "call_kind" and VM_FRAME_... into ZEND_CALL_... 2014-11-28 10:33:03 +03:00
Dmitry Stogov
11384ba77b Pack EX(num_args) into EX(This).u2.num_args 2014-11-28 10:28:49 +03:00
Dmitry Stogov
75041379a6 Improved object property access. 2014-11-06 14:50:03 +03:00
Xinchen Hui
5190d8fb56 Addtion fix for bug #68252 , forget static variable hanlding 2014-10-28 17:42:06 +08:00
Xinchen Hui
e6fe3127d0 Fixed bug #68252 (segfault in Zend/zend_hash.c in function _zend_hash_del_el)
Don't leave a UNDEF gap in function_table
2014-10-28 17:36:03 +08:00
Anatol Belski
f7d3355e75 fix datatype mismatches
and convert len args to size_t where the underlaying API uses zend_string
2014-10-24 20:50:06 +02:00
Nikita Popov
df79b9b27a Update get_class_name semantics
* get_class_name is now only used for displaying the class name
   in debugging functions like var_dump, print_r, etc. It is no
   longer used in get_class() etc.
 * As it is no longer used in get_parent_class() the parent
   argument is now gone. This also fixes incorrect parent classes
   being reported in COM.
 * get_class_name is now always required (previously some places
   made it optional and some required it) and is also required
   to return a non-NULL value.
 * Remove zend_get_object_classname. This also fixes a number of
   potential leaks due to incorrect usage of this function.
2014-10-09 20:48:27 +02:00
Nikita Popov
e5e9d8346f Remove zend_get_class_entry function 2014-10-09 14:17:30 +02:00
Nikita Popov
ee5b30fa19 Remove support for classes without class entries
get_class_entry must be non-NULL and return non-NULL.
2014-10-09 13:58:14 +02:00
Dmitry Stogov
33e137d409 Merged EX(frame_kind) and EX(flags) into single word 2014-10-07 17:12:12 +04:00
Dmitry Stogov
bd9a234645 Replaced EG(This) and EX(object) with EX(This).
Internal functions now recieves zend_execute_data as the first argument.
2014-10-03 19:32:46 +04:00
Nikita Popov
142a01db92 Fix a couple compile warnings 2014-09-29 20:57:17 +02:00
Timm Friebe
e14b7f629b Fix segmentation fault in debug_backtrace() 2014-09-28 20:58:55 +02:00
Nikita Popov
c45924b954 Remove dead code 2014-09-24 12:06:19 +02:00
Xinchen Hui
7ecc7e6bc2 folder marks 2014-09-20 15:16:09 +08:00
Dmitry Stogov
bccc653185 Avoid double IS_INTERNED() check 2014-09-19 17:32:50 +04:00
Nikita Popov
079409bbc2 Switch (un)mangle property name to size_t and zend_string
Also use the _ex variants where possible.
2014-09-16 00:31:27 +02:00
Anatol Belski
c8ed0d81e7 fix signed/unsigned mismatch 2014-09-15 12:58:44 +02:00
Dmitry Stogov
5c897aa7da Preallocate hash tables of required size 2014-09-03 18:21:36 +04:00