summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove local variablesPeter Kokot2019-02-031-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove yearly range from copyright noticeZeev Suraski2019-01-301-1/+1
|
* Revert removal of private __clone() methodsNikita Popov2019-01-141-0/+16
| | | | | | | | | | | | I thought these were redundant, because we already NULL out the clone_obj object handler. However, it turns out that reflection is using private __clone() to determine clonability (isCloneable) for the case where we only have a class, rather than an object. As such, removing these methods would be a BC break. This reverts commit e7131a4e9fa0acf8fc1e486b49851e71859ef5b8. This reverts commit 55bd88ce0d1bf461546d5d0b40920491d566ed48.
* Implement typed propertiesNikita Popov2019-01-111-6/+119
| | | | | | | | | | RFC: https://wiki.php.net/rfc/typed_properties_v2 This is a squash of PR #3734, which is a squash of PR #3313. Co-authored-by: Bob Weinand <bobwei9@hotmail.com> Co-authored-by: Joe Watkins <krakjoe@php.net> Co-authored-by: Dmitry Stogov <dmitry@zend.com>
* Fix some sign-related issues in comparisonsjvoisin2019-01-091-1/+1
|
* Remove unnecessary uses of object_and_properties_initNikita Popov2019-01-071-1/+1
| | | | Use object_init_ex instead if the properties are NULL.
* Remove redundant __clone() methods from ReflectionNikita Popov2018-11-261-16/+0
| | | | | | Reflection classes already use NULLed clone_obj to signal that they cannot be cloned, so it's not necessary to additionally declare a throwing __clone() method.
* Use ZEND_THIS macro to hide implementation details in extensions code.Dmitry Stogov2018-11-151-35/+35
|
* Replace getThis() by EX(This), when additional check is not necessary.Dmitry Stogov2018-11-141-35/+35
|
* Immutable clases and op_arrays.Dmitry Stogov2018-10-171-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 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 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 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 ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 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 b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 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 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc 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 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
* Classify object handlers are required/optionalNikita Popov2018-10-161-1/+1
|
* Clarify that the get_properties handler is requiredNikita Popov2018-10-041-3/+3
| | | | | | 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.
* Write to correct smart_strNikita Popov2018-10-031-1/+1
| | | | Mixed this up during the migration to ZEND_HASH_FOREACH.
* Merge branch 'PHP-7.3'Nikita Popov2018-10-031-7/+5
|\
| * Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2018-10-031-7/+5
| |\
| | * Merge branch 'PHP-7.1' into PHP-7.2Nikita Popov2018-10-031-7/+5
| | |\
| | | * Reflection: Copy invoke function also in the variadic caseNikita Popov2018-10-031-7/+5
| | | | | | | | | | | | | | | | | | | | It doesn't matter how the parameters are provided, we always have to copy the trampoline invoke function.
* | | | Remove uses of apply_with_arguments API in reflectionNikita Popov2018-10-031-124/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of ZEND_HASH_FOREACH. As a side-effect, this fixes a latent bug in _addmethod, where a zval was interpreted as a zval*. Also apply some optimizations to getProperties() while at it: For declared properties, use the HT key instead of unmangling the property name. For dynamic properties check INDIRECT instead of looking up prop info to determine if the property is dynamic.
* | | | Some reflection cleanupsNikita Popov2018-10-021-55/+35
| | | | | | | | | | | | | | | | | | | | Use zend_string and zend_string_tolower in more places, clean up __invoke handling slightly.
* | | | Merge branch 'PHP-7.3'Nikita Popov2018-10-021-0/+10
|\ \ \ \ | |/ / /
| * | | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2018-10-021-0/+10
| |\ \ \ | | |/ /
| | * | Fixed bug #66430Nikita Popov2018-10-021-0/+10
| | | |
* | | | Fixed bug #76737Nikita Popov2018-09-291-13/+19
| | | | | | | | | | | | | | | | | | | | Explicitly prohibit serialization and unserialization of reflection objects.
* | | | Remove redundant ce from reflection property_referenceNikita Popov2018-09-281-8/+5
| | | | | | | | | | | | | | | | | | | | The ce is already stored in the main reflection object, no need to store it twice.
* | | | Only store zend_type inside reflection type_referenceNikita Popov2018-09-281-20/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't need the full arg_info and the baggage associated with it. Storing the type should be safe, as it's part of structures which are never released during a request (arg_info and in the future prop_info).
* | | | Remove unused "dummy" member in reflection_objectNikita Popov2018-09-251-1/+0
| | | |
* | | | Reformat macros in php_reflection.cNikita Popov2018-09-251-20/+19
| | | |
* | | | Replace ZEND_ACC_ANON_BOUND, ZEND_ACC_UNRESOLVED_PARENT and ↵Dmitry Stogov2018-09-181-3/+3
| | | | | | | | | | | | | | | | ZEND_ACC_UNRESOLVED_INTERFACES with single ZEND_ACC_LINKED.
* | | | Get rid of ZEND_ACC_IMPLICIT_PUBLICDmitry Stogov2018-09-111-24/+32
| | | |
* | | | Squashed commit of the following:Dmitry Stogov2018-09-111-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 2d3cac9e005d6bef9aa73ab57cc674aa53125954 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Sep 11 11:54:47 2018 +0300 Fixed static property access commit 31786ee27282f319f3ef2a07635b1f325cbd67c6 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Sep 11 11:05:29 2018 +0300 Avoid duplicate checks commit 5ae502b979ea33d058d01a9421eec5afd0084e8d Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Sep 11 10:39:17 2018 +0300 Optimization commit 82c17f0e8af02c9cf7d1bbdae4e3158330148203 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Sep 11 09:26:50 2018 +0300 Removed unused zend_duplicate_property_info() commit ba53d1d0dd91d5530328a11cac93ff9e75c462b5 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 eacc11b8fdeb002ee6a149defd8b5a8c3412896a 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 62d1871430a1b81c84b790460afff0682648689a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Sep 10 11:55:07 2018 +0300 Fixed issues commit 1d37e3a40e4d07c4b933ed6f9d2e649dd01180f0 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 d6c3f098b6015e76d042691de0af2e1426c66829 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Sep 7 13:56:30 2018 +0300 Get rid of ZEND_ACC_SHADOW
* | | | Merge branch 'PHP-7.3'Christoph M. Becker2018-09-051-2/+4
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #74454: Wrong exception being thrown when using ReflectionMethod
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2018-09-051-2/+4
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix #74454: Wrong exception being thrown when using ReflectionMethod
| | * | Merge branch 'PHP-7.1' into PHP-7.2Christoph M. Becker2018-09-051-2/+4
| | |\ \ | | | |/ | | | | | | | | | | | | * PHP-7.1: Fix #74454: Wrong exception being thrown when using ReflectionMethod
| | | * Fix #74454: Wrong exception being thrown when using ReflectionMethodChristoph M. Becker2018-09-051-2/+4
| | | | | | | | | | | | | | | | | | | | If zend_throw_exception_ex() already threw an exception, we should not throw again.
* | | | Get rid of ZEND_ACC_CTOR, ZEND_ACC_DTOR and ZEND_ACC_IMPLEMENTED_ABSTRACTDmitry Stogov2018-09-051-5/+5
| | | |
* | | | Keep information about unresolved interfaces in ↵Dmitry Stogov2018-08-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | zend_class_entry->interface_names. Move interface implementation code into ZEND_DECLARE_*CLASS opcodes. Remove ZEND_ADD_INTERFACE and ZEND_VERIFY_ABSTRACT_CLASS opcodes.
* | | | Replace zend_class_entry->traits by persistent zend_class_entry->trait_names.Dmitry Stogov2018-08-231-3/+8
| | | | | | | | | | | | | | | | | | | | Move trait binding code into ZEND_DECLARE_*CLASS opcodes. Remove ZEND_ADD_TRIAIT and ZEND_BIND_TRAITS opcodes.
* | | | Fix some misspellingsGabriel Caruso2018-08-121-1/+1
|/ / /
* | | Pack zend_constant.flags and zend_constant.module_number into reserved space ↵Dmitry Stogov2018-07-261-2/+2
| | | | | | | | | | | | inside zend_constant.value.
* | | Changed structure of zend_class_entry.trait_aliases and ↵Dmitry Stogov2018-07-111-3/+3
| | | | | | | | | | | | zend_class_entry.trait_precedences to avoid keeping "intermediate" trait references, that are used only during inheritance.
* | | Uze ZVAL_COPY_DEREF() instead of ZVAL_DEREF() and ZVAL_COPY()Dmitry Stogov2018-07-091-10/+5
| | |
* | | Use zval_ptr_dtor() instead of zval_dtor() in internal functions that ↵Dmitry Stogov2018-07-051-2/+2
| | | | | | | | | | | | destroy new created object (This is safer and produces less code)
* | | Use zval_ptr_dtor() instead of zval_dtor() in internal functions that ↵Dmitry Stogov2018-07-051-5/+5
| | | | | | | | | | | | destroy new created object (This is safer and produces less code)
* | | Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized ↵Dmitry Stogov2018-07-041-4/+4
| | | | | | | | | | | | | | | | | | | | | destructors. zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places. Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
* | | Fix check for invoking abstract methodNikita Popov2018-07-021-15/+13
| | |
* | | Add $ before property name in error messageNikita Popov2018-07-021-2/+2
| | |
* | | Merge branch 'PHP-7.2'Nikita Popov2018-07-021-1/+1
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.1' into PHP-7.2Nikita Popov2018-07-021-1/+1
| |\ \ | | |/
| | * Fixed bug #75231Nikita Popov2018-07-021-1/+1
| | | | | | | | | | | | The behavior is now consistent with ReflectionMethod.
* | | Remove unnecessary explicit argc checkNikita Popov2018-07-021-18/+6
| | | | | | | | | | | | | | | Instead specify a default value for the argument, which is more idiomatic.