summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | | 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
| | |
* | | Add stubs for ext-reflectionThomas Gerbet2019-10-261-424/+204
| | |
* | | Fix and undeprecate ReflectionType::__toString()Nikita Popov2019-10-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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'Joe Watkins2019-10-211-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix bug #78697: inaccurate error message
| * | Merge branch 'PHP-7.3' into PHP-7.4Joe Watkins2019-10-211-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix bug #78697: inaccurate error message
| | * Merge branch 'PHP-7.2' into PHP-7.3Joe Watkins2019-10-211-1/+1
| | |\ | | | | | | | | | | | | | | | | * PHP-7.2: Fix bug #78697: inaccurate error message
| | | * Fix bug #78697: inaccurate error messageFabien Villepinte2019-10-211-1/+1
| | | |
* | | | 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...
* | | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+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.
* | | | Standardize type printing in reflectionNikita Popov2019-09-231-11/+2
| | | | | | | | | | | | | | | | Use ?T instead of "T or NULL".
* | | | Change representation of zend_type from type code to MAY_BE_* maskNikita Popov2019-09-231-34/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This switches zend_type from storing a single IS_* type code to storing a MAY_BE_* type mask. Right now most code still assumes that there is only a single type in the mask (or two together with MAY_BE_NULL). But this will make it a lot simpler to introduce union types. An additional advantage (and why I'm doing this separately), is that a number of special cases no longer need to be handled separately: We can do a single mask & (1 << type) check to handle all simple types, booleans (true|false) and null.
* | | | Make ReflectionType an abstract classNikita Popov2019-09-021-0/+1
| | | | | | | | | | | | | | | | This is never instantiated directly, only child classes are used.
* | | | Move isBuiltin() method from ReflectionType to ReflectionNamedTypeNikita Popov2019-09-021-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method only makes sense for single types, e.g. it would be meaningless for union types. Note that we always return ReflectionNamedType right now, so this does not break compatibility for code using any currently existing types.
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-08-131-4/+5
|\ \ \ \ | |/ / /
| * | | Fixed bug #78410Nikita Popov2019-08-131-4/+5
| | | |
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-07-221-27/+11
|\ \ \ \ | |/ / /
| * | | Special-case rc=1 self-referential arrays in ReflectionReferenceNikita Popov2019-07-221-2/+11
| | | | | | | | | | | | | | | | | | | | New fix for bug #78263. This is special-cased elsewhere in the engine, so we need to mirror it here.
| * | | Revert "Add ReflectionReference::getRefcount()"Nikita Popov2019-07-221-26/+1
| | | | | | | | | | | | | | | | This reverts commit 428cfdd1810b17f0064b7691276f0eb92dc963b6.
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-07-221-11/+10
|\ \ \ \ | |/ / /
| * | | Deprecate Reflection export() methodsNikita Popov2019-07-221-11/+10
| | | | | | | | | | | | | | | | And remove the Reflector::export() interface method.
* | | | Merge branch 'PHP-7.4'Dmitry Stogov2019-07-221-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Evaluate constant in class scope
| * | | Evaluate constant in class scopeDmitry Stogov2019-07-221-1/+1
| | | |
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-07-111-52/+32
|\ \ \ \ | |/ / /
| * | | Don't call Reflection::export() internallyNikita Popov2019-07-111-52/+32
| | | | | | | | | | | | | | | | | | | | | | | | export() methods were implemented in a roundabout way, where they would call Reflection::export(), which would then call __toString(). Cut out the middleman by directly calling __toString().
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-07-081-1/+26
|\ \ \ \ | |/ / /
| * | | Add ReflectionReference::getRefcount()Nikita Popov2019-07-081-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And don't return null for rc=1 references. Leave it to the user to decide whether or not they want to consider these as references or not. Fixes bug #78263.
* | | | Constify some char* arguments or return values of ZEND_APItwosee2019-06-121-3/+3
| | | | | | | | | | | | | | | | Closes GH-4247.
* | | | Add do...while(0) for RETURN_* and ZVAL_* APIstwosee2019-06-121-1/+1
| | | | | | | | | | | | | | | | Closes GH-4255.
* | | | Merge branch 'PHP-7.4'Dmitry Stogov2019-06-061-4/+4
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Cheaper checks for exceptions thrown from __toString()
| * | | Cheaper checks for exceptions thrown from __toString()Dmitry Stogov2019-06-061-4/+4
| | | |
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-06-051-4/+1
|\ \ \ \ | |/ / /
| * | | Deprecate ReflectionType::__toString()Nikita Popov2019-06-051-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We weren't able to do this in 7.1 because the deprecation notice may be converted to an exception and __toString() can't throw, which means that it ultimately become a fatal error. This issue is resolved now, so we can mark the method as deprecated.
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-06-051-27/+40
|\ \ \ \ | |/ / /
| * | | Allow exceptions in __toString()Nikita Popov2019-06-051-31/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge branch 'PHP-7.4'Dmitry Stogov2019-05-281-9/+14
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros
| * | | Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macrosDmitry Stogov2019-05-281-9/+14
| | | |
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-05-141-13/+8
|\ \ \ \ | |/ / /
| * | | Add RETURN_EMPTY_ARRAY() / RETVAL_EMPTY_ARRAY()Nikita Popov2019-05-141-13/+8
| | | | | | | | | | | | | | | | The usual wrappers around ZVAL_EMPTY_ARRAY()...
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-05-091-16/+18
|\ \ \ \ | |/ / /
| * | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-05-091-16/+18
| |\ \ \ | | |/ /
| | * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-05-091-20/+20
| | |\ \ | | | |/
| | | * Fixed bug #75186Nikita Popov2019-05-091-21/+20
| | | |
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-05-091-1/+2
|\ \ \ \ | |/ / /