Commit Graph

912 Commits

Author SHA1 Message Date
Máté Kocsis
0e8070778e
Make get_defined_vars() always return an array
GH-5025
2019-12-20 14:31:57 +01:00
Máté Kocsis
2204dbde3b Add missing ZPP checks
Closes GH-4878.
2019-11-01 15:26:52 +01:00
Nikita Popov
fec0ff8cb0 Merge branch 'PHP-7.4' 2019-10-04 12:42:58 +02:00
Nikita Popov
ca652aafa8 Fixed bug #78632
I'm going for a very conservative fix here, where the previous
logic is restored for the case where an object is passed to
method_exists(). We might want to check against EG(scope) instead,
but this seems like a safer choice.

This means that behavior in PHP 7.4 changes only for
method_exists('C', 'privateMethodNotOnC'), which should be sensible.
2019-10-04 12:41:49 +02:00
Nikita Popov
cc4af3513d Merge branch 'PHP-7.4' 2019-09-03 13:59:59 +02:00
Nikita Popov
6255308624 Report false for inherited private methods in method_exists()
These shadow methods only exist as internal implementation markers.
This mirrors the behavior of property_exists().
2019-09-03 13:59:25 +02:00
Nikita Popov
d93b094584 Throw TypeError from VM implementation of get_class()
The normal function already throws TypeError through the usual zpp
mechanism, but the VM implementation handles this manually and has
not been updated.
2019-08-27 09:37:48 +02:00
Nikita Popov
33886f710c Generate arginfo from PHP stub files
Signature stubs for internal functions are specified in xyz.stub.php,
from which we generate actual arginfo structures in xyz_arginfo.h.
This file then needs to be included in the implementation appropriately.

Arginfo from stubs can be regenerated using scripts/dev/gen_stub.php.
However, this should also automatically happen when the stub file is
modified.
2019-08-09 14:51:25 +02:00
Nikita Popov
8aa92c1465 Merge branch 'PHP-7.4' 2019-07-24 10:52:18 +02:00
Nikita Popov
a49d53baa2 Don't skip uninitialized typed props in get_class_vars()
For bug #78319.
2019-07-24 10:52:01 +02:00
Nikita Popov
227a9c75ec Add types to a couple of builtin functions 2019-06-17 14:47:20 +02:00
Nikita Popov
7d98dd9c1c Merge branch 'PHP-7.4' 2019-06-11 10:29:20 +02:00
Nikita Popov
eecd8961d9 Add get_mangled_object_vars() function 2019-06-11 10:28:29 +02:00
Nikita Popov
252216b2de Remove possible false return value from get_object_vars()
I'm not sure this one ever happens in practice (and we might want
to forbid NULL return from get_properties), but if it does, return
an empty array instead of false.
2019-06-06 09:49:25 +02:00
Dmitry Stogov
e029cc4dd4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Cheaper checks for exceptions thrown from __toString()
2019-06-06 02:23:17 +03:00
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03:00
Nikita Popov
7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Nikita Popov
45a0656e95 Remove get() object handler
Now that set() is gone, there is little point in keeping get(), as
it is essentially just a different way of writing cast_object()
now.

Closes GH-4202.
2019-05-29 17:15:19 +02:00
Dmitry Stogov
c64fe84f8b Merge branch 'PHP-7.4'
* PHP-7.4:
  Avoid double copying
2019-05-28 13:35:29 +03:00
Dmitry Stogov
b2cb6a4a27 Avoid double copying 2019-05-28 13:35:00 +03:00
Nikita Popov
1493c73582 Update MAY_BE_NULL func_info for Zend functions
These cannot return NULL anymore in PHP 8.
2019-05-28 11:43:23 +02:00
Nikita Popov
13f675b858 Merge branch 'PHP-7.4' 2019-05-27 09:38:33 +02:00
Nikita Popov
e6fac86dc3 Accept flags argument in zend_lookup_class_ex()
Instead of a single boolean, so we have space for extension here.
2019-05-27 09:36:25 +02:00
Nikita Popov
20e983d9ce Merge branch 'PHP-7.4' 2019-05-14 14:59:36 +02:00
Nikita Popov
3f19f5112a Add RETURN_EMPTY_ARRAY() / RETVAL_EMPTY_ARRAY()
The usual wrappers around ZVAL_EMPTY_ARRAY()...
2019-05-14 14:59:10 +02:00
Nikita Popov
8ccdb8282e Merge branch 'PHP-7.4' 2019-03-22 09:48:26 +01:00
rjhdby
5456a6ea92 Deduplicate code in zend_builtin_functions.c 2019-03-22 09:47:09 +01:00
Nikita Popov
1016e3a927 Merge branch 'PHP-7.4' 2019-02-19 10:07:47 +01:00
Tyson Andre
12ffee57d6 Fixed bug #77631
Do not include unbound anonymous classes in get_declared_classes().

Note that earlier PHP versions would include the anonymous class in
get_declared_classes(), and return false until the class was bound,
but would not crash.
2019-02-19 10:07:40 +01:00
Nikita Popov
ec694a9e81 Merge branch 'PHP-7.4' 2019-02-14 11:48:06 +01:00
Nikita Popov
1a5cff334d Remove bogus ctor checks in get_class_methods() + reflection
Contrary to the comments, these only hide constructors (old or new
style) if they a) are inherited b) come from a trait and c) are
aliased -- which doesn't make any sense at all.
2019-02-14 11:47:31 +01:00
Dmitry Stogov
4474cf43e6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ZEND_ACC_DTOR flags removal)
2019-02-14 13:18:45 +03:00
Dmitry Stogov
43a7d95016 Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ZEND_ACC_DTOR flags removal) 2019-02-14 13:12:50 +03:00
Dmitry Stogov
91ef4124e5 Refactor zend_object_handlers API to pass zend_object* and zend_string* insted of zval(s). 2019-02-04 13:20:25 +03:00
Peter Kokot
623911f993 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove local variables
2019-02-03 21:23:18 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Nikita Popov
3d39479f4d Remove support for case-insensitive constants
The only remaining case-insensitive constants are null, true and
false, which are handled explicitly.

In the future we may convert them from constants to reserved keywords.
2019-01-31 13:52:06 +01:00
Zeev Suraski
a81202ac49 Adios, yearly copyright ranges 2019-01-30 11:48:28 +01:00
Zeev Suraski
02557f87bc Adios, yearly copyright ranges 2019-01-30 11:23:29 +02:00
Nikita Popov
23a5be3696 Remove ability to declare userland case-insensitive constants
This is part of https://wiki.php.net/rfc/case_insensitive_constant_deprecation.

This commit only removes the ability to declare such constants from
userland. Before the functionality can be removed entirely, it's
necessary to figure out the handling of true/false/null first.
2019-01-30 09:19:02 +01:00
Nikita Popov
6db97f5e3e Remove each()
This has been deprecated in PHP 7.2 as part of
https://wiki.php.net/rfc/deprecations_php_7_2.
2019-01-29 09:42:59 +01:00
Nikita Popov
ee16d99504 Remove create_function()
Deprecated in PHP 7.2 as part of
https://wiki.php.net/rfc/deprecations_php_7_2.
2019-01-28 15:58:23 +01:00
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