Commit Graph

530 Commits

Author SHA1 Message Date
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
0b6063f331 Restore array_key_exists() compatibility for ArrayObject
Doing this by special-casing array_key_exists() for ArrayObject.
2018-10-11 16:10:22 +02:00
Nikita Popov
4d5d77904e Fix foreach/get_object_vars for shadowed properties
If we are in a scope where the shadowed private property is
visible, the shadowing public property should not be visible.
2018-10-10 23:18:34 +02:00
Nikita Popov
7ec8087f80 Introduce get_properties_for() handler
This handler allows getting the object properties for a particular
purpose, such as array casting, serialization, etc.
2018-10-10 10:39:10 +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
Dmitry Stogov
a2e8334613 Allocate only necessary space for static properties of internal classes in ZTS mode. 2018-10-01 19:05:31 +03:00
Nikita Popov
5a4cb3edde Fix missing access errors for guarded properties
If a property access would normally result in a magic method call,
but the property is subject to an active recursion guard, the
access should behave as if the magic method does not exist.

This commit fixes one instance where this was not the case -- we
should have been generating a property access error, but instead
the operation simply did not do anything.
2018-09-27 14:58:26 +02:00
Dmitry Stogov
49b92446d7 Remove zend_check_private() 2018-09-13 13:47:06 +03:00
Dmitry Stogov
a12cd1c5e0 Split error code into "cold" functions and cleanup. 2018-09-13 10:31:49 +03:00
Dmitry Stogov
e1ef054be5 Micro-optimization (condition reordering) 2018-09-13 09:31:38 +03:00
Dmitry Stogov
eb4148e02d typo 2018-09-13 08:49:21 +03:00
Dmitry Stogov
f79270d876 Micro-optimization 2018-09-13 01:41:19 +03:00
Dmitry Stogov
cdeebfd4af Avoid unnecesury iterations over parent classes, in case of no overriden private properties. 2018-09-12 23:47:52 +03:00
Dmitry Stogov
5293dd9d8b Optimize method/property visibility checks 2018-09-12 18:59:12 +03:00
Dmitry Stogov
3444c260a2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76869 (Incorrect bypassing protected method accessibilty check).
2018-09-12 12:27:48 +03:00
Dmitry Stogov
655a99d131 Fixed bug #76869 (Incorrect bypassing protected method accessibilty check). 2018-09-12 12:16:50 +03:00
Dmitry Stogov
aee4b145ef Optimisation: Check for private property in parent class makes sense only if we already found a property info. Check for property started with "\\0" makes sense only if we didn't find property info. 2018-09-12 09:57:36 +03:00
Dmitry Stogov
73efd1b651 Simplify method visibility checks 2018-09-12 08:31:01 +03:00
Dmitry Stogov
06f056a760 Additional fix for bug #76860. 2018-09-11 18:29:27 +03:00
Nikita Popov
e1123e3e4e Drop unused variable 2018-09-11 15:16:11 +02: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
Sara Golemon
7f56150ef2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Enforce ordering of property compare in object comparisons
2018-09-10 08:56:19 -04:00
Sara Golemon
a26a107aae Enforce ordering of property compare in object comparisons 2018-09-10 08:47:50 -04:00
Dmitry Stogov
1321aa5080 Merge branch 'PHP-7.3'
* PHP-7.3:
  Stop using zend_function->reserved[] space.
2018-08-22 10:44:34 +03:00
Dmitry Stogov
8d95f561e4 Stop using zend_function->reserved[] space. 2018-08-22 10:43:51 +03:00
Gabriel Caruso
84b195d9fc Fix some misspellings 2018-08-12 16:15:45 +02:00
Xinchen Hui
642bb9f376 Unused var 2018-08-01 16:45:15 +02:00
Xinchen Hui
85145e509e Unused var 2018-08-01 14:49:06 +08:00
Dmitry Stogov
3ccd985478 Improved method visibility checks 2018-07-31 13:05:57 +03:00
Dmitry Stogov
57527455eb Simplified property name to string conversion 2018-07-31 12:24:53 +03:00
Dmitry Stogov
c42f0ba4f7 Removed useless IS_UNDEF checks 2018-07-31 12:23:46 +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
Dmitry Stogov
d775fe33d1 Better name: ZEND_PROPERTY_HAS => ZEND_PROPERTY_NOT_EMPTY 2018-07-24 09:31:57 +03:00
Xinchen Hui
1638a6e118 Give a meaningful name 2018-07-24 12:51:36 +08:00
Dmitry Stogov
412dd75e05 Perform checks for propertis started with '\\0' only for dynamic properties 2018-07-18 14:49:00 +03:00
Dmitry Stogov
4182b0855f Avoid copying 2018-07-10 13:17:33 +03:00
Dmitry Stogov
7da042cbd8 Use ZVAL_COPY_DEREF() 2018-07-10 12:11:10 +03:00
Dmitry Stogov
0db8c974a5 Avoid useless copying 2018-07-10 12:03:32 +03:00
Dmitry Stogov
dbb9867b3e Avoid useless checks for public functions 2018-07-09 17:30:14 +03:00
Dmitry Stogov
67b4c3379a Uze ZVAL_COPY_DEREF() instead of ZVAL_DEREF() and ZVAL_COPY() 2018-07-09 12:46:46 +03:00
Dmitry Stogov
af341213f7 se zval_ptr_dtor_str() instead of zend_string_release_ex(Z_STR(*), 0) 2018-07-04 12:08:07 +03:00
Dmitry Stogov
6dc0cd868d Fixed ZTS race condition (zend_class_entry->ce_flags of internal classes must not be modified, because internal class enties are shared between threads) 2018-06-27 12:33:20 +03:00
Dmitry Stogov
7f67513ca3 Lazy function copying from op_cache SHM into process memory 2018-06-25 19:53:58 +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
Dmitry Stogov
34e58a6447 Reduced overhead of magic method calls (__get/__set/__unset/__isset/__dectructor/__clone). 2018-06-22 14:29:54 +03:00
Dmitry Stogov
4418d61ca3 Avoid reusing zend_function.common.prototype for magic things (use reserved fields instead). 2018-06-21 13:09:25 +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