Commit Graph

919 Commits

Author SHA1 Message Date
Dmitry Stogov
cec091176c Replace zend_hash_apply... with ZEND_HASH_FOREACH... 2018-12-19 02:49:56 +03:00
Zeev Suraski
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Zeev Suraski
54dc07f3dc Update email addresses. We're still @Zend, but future proofing it... 2018-11-01 17:20:07 +02:00
Nikita Popov
149e6aaa99 Fix accessibility checks for dynamic properties
A dynamic property may be shadowed by a private/protected property.
Make sure we check property accessibility for non-indirect
properties as well.

Closes #3626.
2018-10-22 16:46:33 +02:00
Dmitry Stogov
d57cd36e47 Immutable clases and op_arrays.
Squashed commit of the following:

commit cd0c36c3f9
Merge: 4740dabb84 ad6738e886
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:43:38 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove the "auto" encoding
      Fixed bug #77025
      Add vtbls for EUC-TW encoding

commit 4740dabb84
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:12:28 2018 +0300

    Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes.

commit ad7a78b253
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:46:30 2018 +0300

    Added comment

commit 0276ea5187
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:42:43 2018 +0300

    Added type cast

commit c63fc5d5f1
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:36:51 2018 +0300

    Moved static class members initialization into the proper place.

commit b945548e93
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:21:03 2018 +0300

    Removed redundand assertion

commit d5a4108840
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:19:13 2018 +0300

    Removed duplicate code

commit 8dadca8864
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:05:43 2018 +0300

    Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros.

commit 9ef07c88bd
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:48:29 2018 +0300

    typo

commit a06f0f3d3a
Merge: 94099586ec 3412345ffe
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:47:07 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove unused variable makefile_am_files
      Classify object handlers are required/optional
      Add support for getting SKIP_TAGSTART and SKIP_WHITE options
      Remove some obsolete config_vars.mk occurrences
      Remove bsd_converted from .gitignore
      Remove configuration parser and scanners ignores
      Remove obsolete buildconf.stamp from .gitignore
      [ci skip] Add magicdata.patch exception to .gitignore
      Remove outdated ext/spl/examples items from .gitignore
      Remove unused test.inc in ext/iconv/tests

commit 94099586ec
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 15 23:34:01 2018 +0300

    Immutable clases and op_arrays
2018-10-17 15:52:50 +03:00
Nikita Popov
1cfbb21790 Classify object handlers are required/optional 2018-10-16 20:53:59 +02:00
Nikita Popov
e25b23ed0c Merge branch 'PHP-7.3' 2018-10-06 11:22:24 +02:00
Michael Moravec
0a6ddc7722 Fix bug #76979: define() error message does not mention resources as valid values 2018-10-06 11:21:51 +02:00
Nikita Popov
f48ee1ff58 Clarify that the get_properties handler is required
Some places were checking for non-null get_properties, some weren't.
Make it clear that the handler is required and such checks are not
necessary.
2018-10-04 12:46:50 +02:00
Nikita Popov
10a1cfd17e Merge branch 'PHP-7.3' 2018-09-19 09:40:12 +02:00
Nikita Popov
040ca85eac Merge branch 'PHP-7.2' into PHP-7.3 2018-09-19 09:39:31 +02:00
Nikita Popov
cc1fb02760 Merge branch 'PHP-7.1' into PHP-7.2 2018-09-19 09:39:13 +02:00
Nikita Popov
294fb83ee8 Fixed bug #76901
get_method() may modify the object pointer passed to it if method
forwarding is used. In this case we do not want to modify the
passed zval, so make sure that we copy the object into a temporary
first.
2018-09-19 09:37:04 +02:00
Dmitry Stogov
b634ded197 Class constants and default property values can't be IS_REFERENCE anymore. 2018-09-18 18:46:10 +03:00
Dmitry Stogov
3a249e769b Squashed commit of the following:
commit 2d3cac9e00
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 11:54:47 2018 +0300

    Fixed static property access

commit 31786ee272
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 11:05:29 2018 +0300

    Avoid duplicate checks

commit 5ae502b979
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 10:39:17 2018 +0300

    Optimization

commit 82c17f0e8a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 09:26:50 2018 +0300

    Removed unused zend_duplicate_property_info()

commit ba53d1d0dd
Merge: eacc11b8fd c4b14370cf
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 09:24:13 2018 +0300

    Merge branch 'master' into shadow

    * master:
      7.0.33 next
      Sync NEWS [ci skip]
      add NEWS for 76582
      Enforce ordering of property compare in object comparisons
      Fixed wrong assertion
      Skip test on unsuitable env

commit eacc11b8fd
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Sep 10 13:12:39 2018 +0300

    Fixed failure of ext/spl/tests/array_017.phpt

commit 62d1871430
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Sep 10 11:55:07 2018 +0300

    Fixed issues

commit 1d37e3a40e
Merge: d6c3f098b6 1e550e6f7e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Sep 10 10:21:20 2018 +0300

    Merge branch 'master' into shadow

    * master:
      Update NEWS
      Fix for bug #76582
      Fix ssl stream reneg limit test to print only after first renegotiation
      Make a copy unconditionally
      Fix memory leak in pcre cache
      Remove not needed checking for <errno.h>
      Remove HAVE_ASSERT_H
      Add test for bug #76850
      Fixed bug #76850 Exit code mangled by set locale/preg_match
      Remove empty PHP tags from test
      Fix #75273: php_zlib_inflate_filter() may not update bytes_consumed
      Fix PCRE2 exclusion and remove dead libs in Makefile.gcov
      Report mem leaks to stderr if no Win debugger is present
      Use combined assignment contanation operator
      Fixed bug #76796
      Support fixed address mmap without replacement

commit d6c3f098b6
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Sep 7 13:56:30 2018 +0300

    Get rid of ZEND_ACC_SHADOW
2018-09-11 11:56:45 +03:00
Dmitry Stogov
8939c4d96b Get rid of ZEND_ACC_CTOR, ZEND_ACC_DTOR and ZEND_ACC_IMPLEMENTED_ABSTRACT 2018-09-05 13:16:10 +03:00
Dmitry Stogov
93f9ee7217 Use zend_class_entry/zend_function type names instead of _zend_class_entry/_zend_function tags. 2018-08-22 14:01:14 +03:00
Dmitry Stogov
ab8094c666 Pack zend_constant.flags and zend_constant.module_number into reserved space inside zend_constant.value. 2018-07-26 12:58:07 +03:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Nikita Popov
3588d8af12 Deprecate case-insensitive constants
RFC: https://wiki.php.net/rfc/case_insensitive_constant_deprecation
2018-07-16 19:16:55 +02:00
Christoph M. Becker
6c630eefcb Fix #33502: Some nullary functions don't check the number of arguments
We add the missing zend_parse_parameters_none() checks for:

* output_reset_rewrite_vars()
* func_num_args()
* gc_status()
* gc_disable()
* gc_enable()
* gc_enabled()
* gc_collect_cycles()
* gc_mem_caches()
* zend_version()
2018-07-12 15:05:56 +02:00
Dmitry Stogov
67b4c3379a Uze ZVAL_COPY_DEREF() instead of ZVAL_DEREF() and ZVAL_COPY() 2018-07-09 12:46:46 +03:00
Nikita Popov
2543e61aed Fixed bug #76509
In PHP static properties are shared between inheriting classes,
unless they are explicitly overwritten. However, because this
functionality was implemented using reference, it was possible
to break the implementation by reassigning the static property
reference.

This is fixed by switching the implementation from using references
to using INDIRECTs, which cannot be affected by userland code.
2018-06-25 15:04:09 +02:00
Xinchen Hui
9465ec4673 Added num_roots to gc_status 2018-06-13 16:41:51 +08:00
Dmitry Stogov
e788e8261e Removed "gc_" prefix. 2018-06-13 11:28:24 +03:00
Dmitry Stogov
2afc83732c Allow access to some garbage collection internals (Benjamin Eberlei) 2018-06-13 11:10:17 +03:00
Dmitry Stogov
f2b4ec4bdc Export standard object handlers, to avoid indirect access 2018-05-31 11:57:22 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Dmitry Stogov
a795bd8265 Optimize zend_hash_real_init() 2018-03-23 00:13:45 +03:00
Dmitry Stogov
baa9890112 Completely hide GC implementation details into zend_gc.c 2018-02-27 21:08:26 +03:00
Gabriel Caruso
affc20f891 Use bool instead of boolean in proto 2018-02-04 17:00:24 +01:00
Christoph M. Becker
35e70af208 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #75799 (arg of get_defined_functions is optional)
2018-01-11 13:14:37 +01:00
Christoph M. Becker
7e1d2bd82a Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75799 (arg of get_defined_functions is optional)
2018-01-11 13:13:49 +01:00
Gabriel Caruso
a843a86e6f Fixed bug #75799 (arg of get_defined_functions is optional) 2018-01-11 13:10:47 +01:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
cc12acefcd Use cheaper functions 2017-12-04 13:21:35 +03:00
Xinchen Hui
d56a534acc RC manipulation cleanup 2 2017-11-02 12:13:35 +08:00
Xinchen Hui
a8a17a72b0 RC manipulation cleanup 2017-11-01 10:25:10 +08:00
Nikita Popov
7b16205f8b Remove some unnecessary duplications 2017-10-30 22:48:20 +01:00
Dmitry Stogov
fcc08ce19f Prevent reference-counting on persistent zvals (internal constants, default properties and constants of internal classes).
New macro ZVAL_COPY_OR_DUP() is used perform duplication, if necessary.
This should eliminate related race-coditions in ZTS build and prevent reference-counting bugs after unclean shutdown.
2017-10-30 23:13:10 +03:00
Dmitry Stogov
8e01026b82 Extend zend_register_class_alias_ex() with additional argument to allow creating persistent or per-request aliases 2017-10-27 14:44:21 +03:00
Dmitry Stogov
9cf87aa196 Avoid HashTable allocations for empty arrays (using zend_empty_array). 2017-10-24 17:27:31 +03:00
Dmitry Stogov
ef5ea48741 Always use IS_CONSTANT_AST (IS_CONSTANT is removed). 2017-10-10 10:11:05 +03:00
Dmitry Stogov
cb9d81ef4f Refactored recursion pretection 2017-10-06 01:34:50 +03:00
Xinchen Hui
a8427e7d37 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed arginfo for get_defined_functions
2017-09-12 13:26:25 +08:00
Xinchen Hui
58aa726548 Fixed arginfo for get_defined_functions 2017-09-12 13:26:07 +08:00
Xinchen Hui
ff6f41c94e Narrow typeinfos down for zend_parse_paramenters_none 2017-09-12 11:25:21 +08:00
Sara Golemon
ff04db4420 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix typo in zend_symtable_add_new() API name
2017-09-07 16:29:57 -04:00
Sara Golemon
9369843ee2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix typo in zend_symtable_add_new() API name
2017-09-07 16:26:45 -04:00
Sara Golemon
f18cf46d07 Fix typo in zend_symtable_add_new() API name 2017-09-07 16:25:25 -04:00
Anatol Belski
bc5811f361 further sync for vim mode lines 2017-07-04 18:12:45 +02:00
Nikita Popov
035a27cbc6 Only compute callback name in error cases
Mostly the callback name is only used to report an error. Try to
avoid calculating it if no error occurred.
2017-06-25 18:45:59 +02:00
Nikita Popov
191f154d40 Merge branch 'PHP-7.1' 2017-06-25 15:32:38 +02:00
Nikita Popov
bda0f4e8dc Merge branch 'PHP-7.0' into PHP-7.1 2017-06-25 15:30:29 +02:00
Nikita Popov
de66e80d75 Don't leave holes in func_get_args() and backtraces
Argument lists should always be continuous and hole-free, even if
local variables are unset. Replace UNDEF values with NULLs.
2017-06-25 15:27:45 +02:00
Richard Fussenegger
7cce220be8 Updated some str functions to new parameter API 2017-06-07 23:43:37 +02:00
Dmitry Stogov
490960d861 Avoid useless string duplication 2017-05-23 15:25:21 +03:00
Nikita Popov
b3ca0c2500
zend-test extension to house code that is required for testing internal APIs, but that we would not want to expose for regular builds 2017-03-12 18:58:50 +00:00
Anatol Belski
c698299550 Interned strings unification for TS/NTS
Hereby, interned strings are supported in thread safe PHP. The patch
implements two types of interned strings

- interning per process, strings are not freed till process end
- interning per request, strings are freed at request end

There is no runtime interning.

With Opcache, all the permanent iterned strings are copied into SHM on
startup, additional copying into SHM might happen on demand.
2017-03-04 10:39:13 +01:00
Nikita Popov
06a0340162 Deprecate each() 2017-02-03 21:02:52 +01:00
Nikita Popov
eaeecc523b Deprecate create_function() 2017-02-03 18:52:57 +01:00
Nikita Popov
795a4c1bb3 Merge branch 'PHP-7.1' 2017-02-02 18:35:35 +01:00
Nikita Popov
e81f30ad1d Merge branch 'PHP-7.0' into PHP-7.1 2017-02-02 18:33:42 +01:00
Mitch Hagstrand
dd9cf23457 BUG #73998: Numeric properties are not accessible from get_object_vars 2017-02-02 18:33:10 +01:00
Joe Watkins
306f55bef4
Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed #73973 - debug_zval_dump() assertion error for resource consts with --enable-debug
2017-01-26 09:05:10 +00:00
Joe Watkins
2d339fa4d1
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #73973 - debug_zval_dump() assertion error for resource consts with --enable-debug
2017-01-26 09:04:25 +00:00
andrewnester
f65ae82c55
Fixed #73973 - debug_zval_dump() assertion error for resource consts with --enable-debug 2017-01-26 09:03:47 +00:00
Joe Watkins
e69c9d3bf8
Merge branch 'PHP-7.1'
* PHP-7.1:
  move decl to correct place
2017-01-23 05:34:35 +00:00
Joe Watkins
5589df128c
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  move decl to correct place
2017-01-23 05:34:21 +00:00
Joe Watkins
d636467937
move decl to correct place 2017-01-23 05:33:58 +00:00
Joe Watkins
8782e847b4
Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed #73969 - Fixed segmentation fault when debug_print_backtrace called
2017-01-22 16:12:27 +00:00
Joe Watkins
8bda542064
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #73969 - Fixed segmentation fault when debug_print_backtrace called
2017-01-22 16:11:57 +00:00
andrewnester
6f912f7c04
Fixed #73969 - Fixed segmentation fault when debug_print_backtrace called 2017-01-22 16:11:25 +00:00
Dmitry Stogov
141d1ba980 Introduced "zend_type" - an abstraction for type-hinting representation. 2017-01-13 11:37:46 +03:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Joe Watkins
d83828540e
Merge branch 'PHP-7.1'
* PHP-7.1:
  get_defined_functions additional parameter to exclude disabled functions
  news entry for PR #1312
2017-01-04 13:37:06 +00:00
Joe Watkins
6c9164047e
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  get_defined_functions additional parameter to exclude disabled functions
  news entry for PR #1312
2017-01-04 13:36:04 +00:00
Joe Watkins
63d116e571
Merge branch 'pull-request/1312' into PHP-7.0
* pull-request/1312:
  get_defined_functions extra parameter to exclude disabled functions
  news entry for PR #1312
2017-01-04 13:34:31 +00:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Dmitry Stogov
3e9bb03a62 Removed IS_TYPE_IMMUTABLE (it's the same as COPYABLE & !REFCOUED) 2016-11-28 22:59:57 +03:00
Nikita Popov
dd9ad0940a Fix get_class_vars() fast-path/slow-path discrepancies
Normalize to the fast-path behavior. In particular, make sure that
the the property visibility check is correct for property names that
are formatted like mangled private properties (but are not). This is
done by only calling zend_check_property_access() for INDIRECT
properties.
2016-11-22 20:49:12 +01:00
Andrea Faulds
a0502b89a6 Convert numeric keys in object/array casts
RFC: https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts

This converts key types as appropriate in object to array and array to object
casts, as well as in get_object_vars().
2016-11-14 18:20:45 +00:00
Joe Watkins
b0cacee303 Merge branch 'pull-request/2082' 2016-10-10 12:14:26 +01:00
Dmitry Stogov
6be2e79c2c On PHP-7.1 and above we have to check CALL_INFO instead of symbol_table. 2016-09-26 16:16:07 +03:00
Dmitry Stogov
bca7f02933 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73156 (segfault on undefined function)
2016-09-26 14:17:27 +03:00
Dmitry Stogov
d279118422 Fixed bug #73156 (segfault on undefined function) 2016-09-26 14:14:57 +03:00
John Boehr
68e602ff0a Fix bug #69579 2016-09-22 12:38:07 +02:00
Nikita Popov
7cd2494bb8 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-22 12:34:55 +02:00
John Boehr
8e313becf4 Fix bug #69579 2016-09-22 12:32:37 +02:00
Andrea Faulds
fc5497cb92 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 22:46:20 +01:00
Andrea Faulds
d690014bf3 Remove zpp fallback code (always use Fast ZPP)
Squashed commit of the following:

commit 3e27fbb3d2
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Sep 11 19:14:37 2016 +0100

    Keep dummy FAST_ZPP macro for compatibility

commit 8a7cfd00de
Author: Andrea Faulds <ajf@ajf.me>
Date:   Mon Sep 5 22:36:03 2016 +0100

    Remove FAST_ZPP macro and plain zpp fallback code
2016-09-11 22:44:46 +01:00
Dmitry Stogov
ff06588130 Fixed use after free 2016-08-16 11:44:22 +03:00
Danack
86aa1c784d Require parameter to be an object if passed. 2016-08-11 23:21:04 +01:00
Dmitry Stogov
0cfb47651c Fixed compilation warnings 2016-06-28 11:37:51 +03:00
Dmitry Stogov
f8faffe37e Merge branch 'PHP-7.0'
* PHP-7.0:
  Allow "proxy" ovjects to substitute their class names through get_class_name() handler (similar to var_dump() and others).
2016-06-22 17:28:59 +03:00
Dmitry Stogov
3c84e5e1ce Allow "proxy" ovjects to substitute their class names through get_class_name() handler (similar to var_dump() and others). 2016-06-22 17:23:04 +03:00
Nikita Popov
91f5940329 Forbid dynamic calls to scope introspection functions
Per RFC:
https://wiki.php.net/rfc/forbid_dynamic_scope_introspection
2016-05-24 20:48:24 +02:00
Dmitry Stogov
7b94b958cc Intern some known (and offten used) strings. 2016-05-12 13:47:22 +03:00
Xinchen Hui
4cd9cf8257 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed test
  Revert "Fix bug #72162 (again)"
2016-05-06 10:53:25 +08:00
Xinchen Hui
441d1b8ef0 Revert "Fix bug #72162 (again)"
The problem is because we release p->value too early

and later you try to convert an object to string, which is a fatal error

then leave p->value double free, change to expect long is a BC break

This reverts commit 8e5b381004.
2016-05-06 10:45:44 +08:00
Nikita Popov
59f35c0ca9 Merge branch 'PHP-7.0'
Conflicts:
	Zend/zend_builtin_functions.c
2016-05-05 17:31:25 +02:00
Nikita Popov
8e5b381004 Fix bug #72162 (again)
Not sure what the previous fix was supposed to do. The issue was
that error_reporting() simply assumes that the value must either
be an integer or a string.

Fixed by using zpp properly.
2016-05-05 17:28:52 +02:00
Xinchen Hui
badf1edffd Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72162 (use-after-free - error_reporting)
2016-05-05 11:02:34 +08:00
Xinchen Hui
9191862121 Fixed bug #72162 (use-after-free - error_reporting) 2016-05-05 11:02:21 +08:00
Dmitry Stogov
2578d08033 Fixed compilation warnings 2016-04-29 14:44:56 +03:00
Dmitry Stogov
6499162ff0 - get rid of EG(scope). zend_get_executed_scope() should be used instead.
- ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter.
2016-04-28 04:13:34 +03:00
Dmitry Stogov
7abfaac901 Merge zend_execute_data->called_scope into zend_execute_data->This.
"called_scope" made sense only for static method calls, for dynamic calls it was always equal to the class of $this.
Now EG(This) may store IS_OBJECT + $this or IS_UNUSED + "called_scope" (of course, "called_scope" may be NULL).
Some code might need to be adopted to support this change.
Checks (Z_OBJ(EX(This))) might need to be converted into (Z_TYPE(EX(This)) == IS_OBJECT).
2016-04-01 16:17:49 +03:00
Xinchen Hui
1e5ac8940a Merge branch 'PHP-7.0'
* PHP-7.0:
  Fix bug #71835 (json_encode sometimes incorrectly detects recursion with JsonSerializable)
2016-03-21 16:22:02 +08:00
Jakub Zelenka
7e069daa89 Fix bug #71835 (json_encode sometimes incorrectly detects recursion with JsonSerializable) 2016-03-20 15:56:27 +00:00
Xinchen Hui
0df9b51479 Return meaningful value 2016-01-22 15:34:56 +08:00
Xinchen Hui
b27e10284a Empty line 2016-01-21 14:37:54 +08:00
Xinchen Hui
145555f81c Cover overloaded functions 2016-01-21 14:31:03 +08:00
Xinchen Hui
2ee73ee094 Let's add a class entry for testing 2016-01-21 13:53:29 +08:00
Xinchen Hui
86883b793b Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #71336 (Wrong is_ref on properties as exposed via get_object_vars())
2016-01-13 17:38:36 +08:00
Xinchen Hui
39f0950746 Fixed bug #71336 (Wrong is_ref on properties as exposed via get_object_vars()) 2016-01-13 17:38:18 +08:00
Xinchen Hui
563659822d Merge branch 'PHP-7.0' 2016-01-02 17:56:54 +08:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Xinchen Hui
7a5c663ec6 Merge branch 'PHP-7.0' 2015-12-25 20:32:46 -08:00
Xinchen Hui
6700be67f5 Fixed bug #71221 (Null pointer deref (segfault) in get_defined_vars via ob_start) 2015-12-25 20:32:26 -08:00
Dmitry Stogov
ef6514d652 Don't use deprecated API 2015-12-16 16:01:09 +03:00
Xinchen Hui
d70aa14f2c Fixed bug #70323 (Regression in zend_fetch_debug_backtrace() can cause segfaults) 2015-11-09 17:14:15 +08:00
Xinchen Hui
a9636ff5a2 Fixed bug #70555 (fun_get_arg() on unsetted vars return UNKNOW)
and also keep the indices of func_get_args(). since they are similar
issue of #70574, thus reuse its test script.
2015-09-23 10:00:20 +08:00
Xinchen Hui
0f3ab1c2d0 Fixed #70547 similar bug in func_get_args 2015-09-22 13:58:42 +08:00
Xinchen Hui
e1dcfd2cf9 Fixed bug #70547 (unsetting function variables corrupts backtrace) 2015-09-22 11:59:35 +08:00
Xinchen Hui
d5b78cec64 We should keep one refcount to resource 2015-09-02 22:14:48 -07:00
Xinchen Hui
6815c08e29 Fixed bug #70398 (SIGSEGV, Segmentation fault zend_ast_destroy_ex) 2015-09-02 22:07:29 -07:00
Nikita Popov
13567d5dee Don't copy zend_strings during exception creation
Minor optimization...
2015-08-14 16:16:27 +02:00
Xinchen Hui
a094f4faed Remove useless insert 2015-08-14 17:09:27 +08:00
Dmitry Stogov
668ecaa606 Fixed bug #70098 (Real memory usage doesn't decrease) 2015-08-04 18:21:05 +03:00
Xinchen Hui
3422fb57c8 Use hash_str directly 2015-07-02 12:31:26 +08:00
Rasmus Lerdorf
324d5ecb7e debug_print_backtrace has a 2nd optional arg 2015-06-30 09:57:49 -07:00
Dmitry Stogov
7aa7627172 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 13:59:27 +03:00
Rasmus Lerdorf
1201be392f 3rd arg to define() is optional 2015-06-23 23:53:23 -04:00
Rasmus Lerdorf
41774bceff Fix more minor mistakes in the proto comments 2015-06-23 15:47:33 -04:00
Rasmus Lerdorf
f4d08d8e5c Fix incorrect protos 2015-06-23 14:15:24 -04:00
Dmitry Stogov
ed418312a5 Revert "Fix arginfo for built-in engine functions"
This reverts commit d2356541d0.
2015-06-22 11:44:57 +03:00
Dmitry Stogov
3db071dba2 Revert "Fix set_error_handler() arginfo"
This reverts commit b5240280b0.
2015-06-22 11:44:49 +03:00
Dmitry Stogov
82b92cfa2e Revert "And actually use this new arginfo data"
This reverts commit 932c95fb31.
2015-06-22 11:44:39 +03:00
Dmitry Stogov
539593ce15 Revert "Fix each() arginfo"
This reverts commit 19fd124bcf.
2015-06-22 11:44:29 +03:00
Dmitry Stogov
9a68fe51d7 Revert "Fix genarginfo to respect by-ref passing"
This reverts commit db6990a91b.
2015-06-22 11:44:13 +03:00
Dmitry Stogov
13d5893c2a Revert "Several return type fixes, still not completed... Incomplete prototypes :-/"
This reverts commit 851b95fc49.
2015-06-22 11:44:01 +03:00
Bob Weinand
851b95fc49 Several return type fixes, still not completed... Incomplete prototypes :-/ 2015-06-22 10:36:42 +02:00
Bob Weinand
db6990a91b Fix genarginfo to respect by-ref passing 2015-06-22 10:17:35 +02:00
Bob Weinand
19fd124bcf Fix each() arginfo 2015-06-22 10:03:14 +02:00
Rasmus Lerdorf
932c95fb31 And actually use this new arginfo data 2015-06-22 00:12:48 -04:00
Rasmus Lerdorf
b5240280b0 Fix set_error_handler() arginfo 2015-06-21 23:48:00 -04:00
Rasmus Lerdorf
d2356541d0 Fix arginfo for built-in engine functions 2015-06-21 21:50:09 -04:00
Dmitry Stogov
4a6e1345e2 Use COW to prevent unnecessary duplication of dynamic propertyes of stdClass (and other classes without predefined properties). 2015-06-17 12:50:16 +03:00
Dmitry Stogov
1c754f0b71 Get rid of more ZVAL_ZVAL() macros 2015-06-12 13:33:14 +03:00
Dmitry Stogov
8e10e8f921 Avoid zval duplication in ZVAL_ZVAL() macro (it was necessary only in few places).
Switch from ZVAL_ZVAL() to simpler macros where possible (it makes sense to review remaining places)
2015-06-12 12:33:23 +03:00
Willian Gustavo Veiga
33721742a5 Added "exclude_disabled" argument to "get_defined_functions". 2015-06-02 21:42:18 -03:00
Willian Gustavo Veiga
978832331a Fix bug #31875 - get_defined_functions() should not list disabled functions. 2015-05-30 12:29:27 -03:00
Dmitry Stogov
ca64b41b99 Fixed zend_update_class_constants() to always resolve all constants.
Call zend_update_class_constants() only when necessary.
2015-05-21 04:13:10 +03:00
Dmitry Stogov
49cf7c5d12 Don't propogate "fake" EX(called_scope) and EX(This) into each internal function.
They need quite seldom and it's cheaper to get them from corresponfing upper stack frame.
2015-04-23 12:16:37 +03:00
Bob Weinand
f3e124d58d Merge branch 'coroutineDelegation' of https://github.com/bwoebi/php-src 2015-04-14 17:58:58 +02:00
Dmitry Stogov
5e8133f453 Squashed commit of the following:
commit 2399fc84c5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 12:38:08 2015 +0300

    Removed useless assignment

commit 796b633817
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 12:35:31 2015 +0300

    Fixed execution with overriden zend_execute_ex()

commit 4a9fb125aa
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 02:02:58 2015 +0300

    Fixed executor without global registers

commit d456c30e00
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 01:30:35 2015 +0300

    Restored original behavior for tests/classes/__call_004.phpt

commit 479646d37f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 00:32:17 2015 +0300

    Fixed test. We don't keep stack frame for fake function anymore.

commit 9ae61e33e2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 00:30:09 2015 +0300

    Use ZEND_ACC_CALL_VIA_TRAMPOLINE instead of ZEND_ACC_CALL_VIA_HANDLER. Keep ZEND_ACC_CALL_VIA_HANDLER for compatibility.

commit 0a8403a2a0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 00:05:43 2015 +0300

    Rename PROXY_CALL into CALL_TRAMPLINE.
    Generalize API to allow reuse EG(trampline) for other purposes.

commit 4ea0525c10
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 23:22:25 2015 +0300

    Reuse EG(proxy_call_op) for all proxy. Move proxy related functions from zend_objects_API to zend_object_handlers.

commit 529bf737ca
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 21:42:23 2015 +0300

    Accurate use of proxy_call

commit 5d62837d5b
Merge: 83e749f 690843f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 19:40:00 2015 +0300

    Merge branch 'master' into opcodefy-call

    * master:
      Fixed GOTO executor
      Fixed typo
      Changed ArrayIterator implementation using zend_hash_iterator_... API. Allowed modification of itterated ArrayObject using the same behavior as proposed in `Fix "foreach" behavior`. Removed "Array was modified outside object and internal position is no longer valid" hack.

commit 83e749ff3b
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 19:39:10 2015 +0300

    Improved ZEND_PROXY_CALL

commit 0c829afc53
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 15:14:49 2015 +0300

    Reverted white-space changes

commit df65144488
Merge: 5fd2f97 97756d9
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 14:37:07 2015 +0300

    Merge branch 'opcodefy-call' of github.com:laruence/php-src into opcodefy-call

    * 'opcodefy-call' of github.com:laruence/php-src:
      Ready for PR
      Fixed static call
      Improve performance by using prealloated op_arrray
      Respect called_scope
      Support internal magical __call/__callStatic
      opcode-fy magical __callStatic
      Opcode-fy magical __call

commit 97756d9190
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 19:07:59 2015 +0800

    Ready for PR

commit 74f9930846
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 19:03:00 2015 +0800

    Fixed static call

commit ec1d9eb592
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 18:23:17 2015 +0800

    Improve performance by using prealloated op_arrray

commit df7fbbf949
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 15:10:02 2015 +0800

    Respect called_scope

commit 769d1d59fb
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 12:19:23 2015 +0800

    Support internal magical __call/__callStatic

commit a980fedd5b
Author: Xinchen Hui <laruence@gmail.com>
Date:   Wed Apr 8 18:35:41 2015 +0800

    opcode-fy magical __callStatic

commit 73855f7d53
Author: Xinchen Hui <laruence@gmail.com>
Date:   Wed Apr 8 14:21:55 2015 +0800

    Opcode-fy magical __call
2015-04-10 23:01:00 +03:00
Xinchen Hui
f23f7dfed0 Use new macros 2015-04-08 14:30:47 +08:00
Dmitry Stogov
bf259db82e Recalssify some E_ERROR into E_CORE_ERROR 2015-04-02 13:07:17 +03:00
Dmitry Stogov
ea09a9fa32 Convert fatal errors into EngineExceptions
Make zval_update_constant_ex(), zval_update_constant(), zend_update_class_constants() and zend_ast_evaluate() return SUCCESS or FAILURE.
2015-04-02 02:05:25 +03:00
Dmitry Stogov
acfc31c0f8 Use zend_error_noreturn() for fatal errors 2015-04-01 13:32:23 +03:00
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
Bob Weinand
b4a142ab97 Added yield from operator 2015-03-07 00:28:12 +01: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