summaryrefslogtreecommitdiff
path: root/ext/reflection
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-01-172-0/+18
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fixed bug #79115
| | * Fixed bug #79115Nikita Popov2020-01-172-0/+18
| | |
* | | Use zend_type inside type listsNikita Popov2020-01-171-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having a completely independent encoding for type list entries. This is going to use more memory, but I'm not particularly concerned about that, as type unions that contain multiple classes should be uncommon. On the other hand, this allows us to treat top-level types and types inside lists mostly the same. A new ZEND_TYPE_FOREACH macros allows to transparently treat list and non-list types the same way. I'm not using it everywhere it could be used for now, just the places that seemed most obvious. Of course, this will make any future type system changes much simpler, as it will not be necessary to duplicate all logic two times.
* | | Fix #78880: Final spelling fixesMáté Kocsis2020-01-161-1/+1
| | |
* | | Fix reflection leak if type inside type list is resolvedNikita Popov2020-01-162-18/+13
| | |
* | | Fix #78880: Another bunch of spelling errorsMáté Kocsis2020-01-161-1/+1
| | |
* | | Use RETURN_THROWS() in various placesMáté Kocsis2020-01-031-3/+3
| | |
* | | Use RETURN_THROWS() after try_convert_to_string()Máté Kocsis2020-01-031-1/+1
| | |
* | | Use RETURN_THROWS() after zend_throw_exception() in reflection extensionMáté Kocsis2020-01-032-63/+59
| | |
* | | Use RETURN_THROWS() after zend_throw_error()Máté Kocsis2020-01-011-1/+1
| | |
* | | Use RETURN_THROWS() after zend_type_error()Máté Kocsis2020-01-011-1/+1
| | |
* | | Use RETURN_THROWS() during ZPP in the remaining extensionsMáté Kocsis2019-12-311-167/+167
| | | | | | | | | | | | In reflection, sodium, and SPL
* | | Fix #78880: Spelling error reportChristoph M. Becker2019-12-2111-56/+56
| | | | | | | | | | | | | | | | | | | | | We fix the most often occuring typos according to a recent codespell report[1] in tests, code comments and documentation. [1] <https://fossies.org/linux/test/php-src-master-f8f48ce.191129.tar.gz/codespell.html>.
* | | Merge branch 'PHP-7.4'Dmitry Stogov2019-12-092-1/+40
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fixed bug #78895 (Reflection detects abstract non-static class as abstract static. IS_IMPLICIT_ABSTRACT is not longer used)
| * | Fixed bug #78895 (Reflection detects abstract non-static class as abstract ↵Dmitry Stogov2019-12-092-1/+40
| | | | | | | | | | | | static. IS_IMPLICIT_ABSTRACT is not longer used)
* | | Add union return types with one classMáté Kocsis2019-11-182-13/+10
| | |
* | | Implement union typesNikita Popov2019-11-085-18/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to RFC: https://wiki.php.net/rfc/union_types_v2 The type representation now makes use of both the pointer payload and the type mask at the same time. Additionall, zend_type_list is introduced as a new kind of pointer payload, which is used to store multiple class types. Each of the class types is a tagged pointer, which may be either a class name or class entry. The latter is only used for typed properties, while arguments/returns will instead use cache slots. A type list can contain a mix of both names and CEs at the same time, as not all classes may be resolvable. One thing this is missing is support for union types in arginfo and stubs, which I want to handle separately. I've also dropped the special object code from the JIT implementation for now -- I plan to add this back in a different form at a later time. For now I did not want to include non-trivial JIT changes together with large functional changes. Another possible piece of follow-up work is to implement "iterable" as an internal alias for "array|Traversable". I believe this will eliminate quite a few special-cases that had to be implemented. Closes GH-4838.
* | | Make zend_type a 2-field structNikita Popov2019-11-081-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now store the pointer payload and the type mask separately. This is in preparation for union types, where we will be using both at the same time. To avoid increasing the size of arginfo structures, the pass_by_reference and is_variadic fields are now stored as part of the type_mask (8-bit are reserved for custom use). Different types of pointer payloads are distinguished based on bits in the type_mask.
* | | Clean DONE tags from testsFabien Villepinte2019-11-0749-103/+0
| | | | | | | | | | | | | | | | | | | | | Remove most of the `===DONE===` tags and its variations. Keep `===DONE===` if the test output otherwise becomes empty. Closes GH-4872.
* | | Merge branch 'PHP-7.4'Fabien Villepinte2019-11-041-0/+7
|\ \ \ | |/ /
| * | Add a test for ReflectionClass:getInterfaceNames()Fabien Villepinte2019-11-041-0/+7
| | | | | | | | | | | | The method was not tested against a class without interface.
* | | Remove dead code related to inherits props in reflectionNikita Popov2019-11-041-29/+0
| | | | | | | | | | | | | | | | | | Public/protected properties defined in parent classes will be inherited in the child -- there is no need to explicitly try to walk up the chain and look them up.
* | | Store pointer to property_info in reflectionNikita Popov2019-11-041-61/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of constructing a dummy property_info for dynamic properties, leave the field as NULL and handle this as appropriate. This was originally part of an alternative fix for bug #78774, but I think doing it this way is generally preferrable independently of that.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-11-042-1/+35
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fixed bug #78774
| * | Fixed bug #78774Nikita Popov2019-11-042-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The string held by the zend_type may be released if the property type gets resolved to a CE. I initially wanted to fix this by storing a zend_type* instead (so the property type resolution propagates to the ReflectionType), but decided against this in light of upcoming union types support, where we also need to represent parts of the union, and will not have a single zend_type* we can reference.
* | | zend_parse_parameters_throw() is obsoleteChristoph M. Becker2019-11-011-9/+9
| | | | | | | | | | | | | | | | | | Since `zend_parse_parameters()` throws now, there is no reason to explicitly call `zend_parse_parameters_throw()` anymore, and since both have actually the same implementation, we redefine the latter as macro.
* | | Add missing zend_parse_parameters_none()Christoph M. Becker2019-10-281-0/+33
| | | | | | | | | | | | | | | We fix the trivial cases; some others need further discussion, see <https://news-web.php.net/php.internals/107723>.
* | | Revert "Add missing zend_parse_parameters_none()"Christoph M. Becker2019-10-271-45/+0
| | | | | | | | | | | | | | | This reverts commit ef439ec895a97a12e8f88c3371dfc8881a501649. Test failures need to be resolved first.
* | | Add missing zend_parse_parameters_none()Christoph M. Becker2019-10-271-0/+45
| | |
* | | Fix and make reflection arginfo stubs more specificChristoph M. Becker2019-10-261-14/+14
| | |
* | | Improve reflection arginfo stubsChristoph M. Becker2019-10-263-61/+74
| | |
* | | Add stubs for ext-reflectionThomas Gerbet2019-10-265-439/+1329
| | |
* | | Fix and undeprecate ReflectionType::__toString()Nikita Popov2019-10-223-17/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add deprecated _ZendTestClass::__toString() method to preserve an existing test. ReflectionType::__toString() will now return a complete representation of the type, as it should have originally. Users that relied on nullability being absent should have been pushed to ReflectionNamedType::getName() by the deprecation of ReflectionType::__toString() in PHP 7.1 / PHP 7.4.
* | | Merge branch 'PHP-7.4'Fabien Villepinte2019-10-213-70/+0
|\ \ \ | |/ /
| * | Revert "Add tests for ReflectionZendExtension"Fabien Villepinte2019-10-213-70/+0
| | | | | | | | | | | | | | | | | | This reverts commit 4194e0415b02827b0d5eeff13771eb6642955b0f. There were already tests for this class.
* | | Merge branch 'PHP-7.4'Fabien Villepinte2019-10-213-0/+70
|\ \ \ | |/ /
| * | Add tests for ReflectionZendExtensionFabien Villepinte2019-10-213-0/+70
| | |
* | | Merge branch 'PHP-7.4'Joe Watkins2019-10-213-31/+45
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix bug #78697: inaccurate error message
| * | Merge branch 'PHP-7.3' into PHP-7.4Joe Watkins2019-10-213-31/+45
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix bug #78697: inaccurate error message
| | * Merge branch 'PHP-7.2' into PHP-7.3Joe Watkins2019-10-213-31/+45
| | |\ | | | | | | | | | | | | | | | | * PHP-7.2: Fix bug #78697: inaccurate error message
| | | * Fix bug #78697: inaccurate error messageFabien Villepinte2019-10-213-31/+45
| | | |
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-10-071-1/+1
|\ \ \ \ | |/ / /
| * | | Fix number of required arguments in arginfoNikita Popov2019-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pack() only requires one argument * stream_context_set_option() only requires two arguments * ReflectionMethod::getClosure() accepts no args for static methods * DOMDocument::createProcessingInstruction() only requires one arg * DOMImplementation::createDocument() only requires two arguments * DOMDocument::importNode() only requires one arg * mysql_get_client_version() doesn't accept any args, despite what the docs say...
* | | | Convert some notices to warningsNikita Popov2019-10-022-2/+2
| | | | | | | | | | | | | | | | Part of https://wiki.php.net/rfc/engine_warnings.
* | | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-252-4/+0
| | | | | | | | | | | | | | | | Closes GH-4732.
* | | | Add check_only parameter to get_closure handlerChristoph M. Becker2019-09-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `get_closure` handlers are called to check whether an object is callable, and to actually get the closure, respectively. The behavior of the handler might differ for these two cases, particularly the handler may throw in the latter case, but should not in the former. Therefore we add a `check_only` parameter, to be able to distinguish the desired purpose.
* | | | Use ZEND_TYPE_IS_SET() when checking for property typesNikita Popov2019-09-231-2/+2
| | | | | | | | | | | | | | | | | | | | Instead of a simple if or 0 comparison. This would no longer work if zend_type is a struct.
* | | | Don't set nullability flag for parameters without typeNikita Popov2019-09-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use value 0 instead. To compensate we check in ReflectionParameter allowsNull() whether the type is set at all: If it isn't, it always allows null. This removes a discrepancy between internal&userland functions: For userland functions allowsNull() on untyped parameters returned true, but for internal functions it returned false.
* | | | Update error messages in some more testsNikita Popov2019-09-232-2/+2
| | | |
* | | | Standardize type printing in reflectionNikita Popov2019-09-232-13/+4
| | | | | | | | | | | | | | | | Use ?T instead of "T or NULL".