summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix usage of casted string in ReflectionParameter ctorNikita Popov2020-11-241-2/+2
| | | | Fixes oss-fuzz #27755.
* Fix leak on consteval exception in ReflectionClass::__toString()Nikita Popov2020-08-311-0/+1
|
* Check update constant failure in ReflectionClassConstant::__toString()Nikita Popov2020-08-311-1/+4
|
* Fixed bug #79820Christopher Broadbent2020-07-151-0/+17
| | | | | | | | | Similar to what is done for ReflectionType itself, copy the type name stored inside ReflectionProperty. Also make sure the type field is always initialized for dynamic properties. This is a non-issue in PHP 8, because we store a pointer to the property_info there, rather than a copy.
* Fix #69804: ::getStaticPropertyValue() throws on protected propsChristoph M. Becker2020-06-241-3/+11
| | | | | | | | | | | | `ReflectionClass` allows reading of the values of private and protected constants, and also to get private and protected static methods. Therefore getting the values of private and protected static properties is also permissible, especially since `::getStaticProperties()` already allows to do so. We also allow ::setStaticPropertyValue() to modify private and protected properties, because otherwise this method is useless, as modifying public properties can be done directly.
* Fix #79487: ::getStaticProperties() ignores property modificationsChristoph M. Becker2020-06-241-4/+31
| | | | | When retrieving the static class properties via reflection, we have to cater to possible modifications.
* Revert "Fix #79487: ::getStaticProperties() ignores property modifications"Christoph M. Becker2020-06-231-31/+4
| | | | This reverts commit a895bb6885fbceea3e8375816969d5510d8d082e.
* Fix #79487: ::getStaticProperties() ignores property modificationsChristoph M. Becker2020-06-231-4/+31
| | | | | When retrieving the static class properties via reflection, we have to cater to possible modifications.
* Apply tidy formattingNikita Popov2020-02-031-1/+1
| | | | Mostly reindent PHP scripts to spaces.
* Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-01-171-0/+2
|\ | | | | | | | | * PHP-7.3: Fixed bug #79115
| * Fixed bug #79115Nikita Popov2020-01-171-0/+2
| |
* | Fixed bug #78895 (Reflection detects abstract non-static class as abstract ↵Dmitry Stogov2019-12-091-1/+2
| | | | | | | | static. IS_IMPLICIT_ABSTRACT is not longer used)
* | Fixed bug #78774Nikita Popov2019-11-041-1/+13
| | | | | | | | | | | | | | | | | | | | 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.
* | 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
| | |
* | | 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...
* | | Fixed bug #78410Nikita Popov2019-08-131-4/+5
| | |
* | | 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.
* | | Deprecate Reflection export() methodsNikita Popov2019-07-221-11/+10
| | | | | | | | | | | | And remove the Reflector::export() interface method.
* | | Evaluate constant in class scopeDmitry Stogov2019-07-221-1/+1
| | |
* | | 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().
* | | 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.
* | | Cheaper checks for exceptions thrown from __toString()Dmitry Stogov2019-06-061-4/+4
| | |
* | | 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.
* | | 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.
* | | Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macrosDmitry Stogov2019-05-281-9/+14
| | |
* | | Add RETURN_EMPTY_ARRAY() / RETVAL_EMPTY_ARRAY()Nikita Popov2019-05-141-13/+8
| | | | | | | | | | | | The usual wrappers around ZVAL_EMPTY_ARRAY()...
* | | 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
| | |
* | | Fixed bug #77951Nikita Popov2019-05-091-1/+2
| | | | | | | | | | | | | | | Treat singleton references as non-references in ReflectionReference and return null for them.
* | | Use fast zpp for ReflectionClass constructorNikita Popov2019-05-081-6/+6
| | | | | | | | | | | | | | | At this point zpp overhead makes up a significant part of this function.
* | | Optimize $name/$class property population in reflectionNikita Popov2019-05-081-102/+64
| | | | | | | | | | | | | | | Instead of going through write_property, directly assign to the respective property slot.
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-04-151-0/+8
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-04-151-0/+8
| |\ \ | | |/
| | * Fixed bug #77882Nikita Popov2019-04-151-0/+8
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-03-221-4/+14
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-03-221-4/+14
| |\ \ | | |/
| | * Fixed bug #77772Nikita Popov2019-03-221-14/+12
| | |
| | * Trim trailing whitespace in source code filesPeter Kokot2018-10-131-5/+5
| | |
* | | Don't return inside _DO_THROW macroNikita Popov2019-02-281-14/+18
| | | | | | | | | | | | | | | Returning inside _DO_THROW() is kind of pointless if we are going to comment most uses with "this is gonna return".
* | | Fix #77673 ReflectionClass::getDefaultProperties returns spooky arrayJoe Watkins2019-02-271-1/+1
| | |
* | | Fix typos in code comments [skip ci]Tyson Andre2019-02-181-1/+1
| | |
* | | Remove bogus ctor checks in get_class_methods() + reflectionNikita Popov2019-02-141-22/+12
| | | | | | | | | | | | | | | | | | 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.
* | | Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ↵Dmitry Stogov2019-02-141-5/+5
| | | | | | | | | | | | ZEND_ACC_DTOR flags removal)
* | | Implement ReflectionReferenceNikita Popov2019-02-131-1/+123
| | | | | | | | | | | | RFC: https://wiki.php.net/rfc/reference_reflection
* | | 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
| | |