summaryrefslogtreecommitdiff
path: root/Zend/zend_attributes.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-8.0'Máté Kocsis2021-03-061-1/+1
|\
| * Fix the error message of attribute flag validationMáté Kocsis2021-03-061-1/+1
| |
* | Generate zend class entries based on stubsMáté Kocsis2021-02-141-14/+3
| | | | | | | | Closes GH-6685
* | Replace zend_bool uses with boolNikita Popov2021-01-151-1/+1
|/ | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* Don't use scope when validating AttributeNikita Popov2020-12-011-1/+4
| | | | | | | This is not safe to do at this point. Even if we made it safe, we'd see inconsistencies due to a partially compiled class. Fixes oss-fuzz #28129.
* Honor strict_types=1 for attributes, improve backtracesNikita Popov2020-09-271-16/+9
| | | | | | | | | | | | | | | | | Make ReflectionAttribute::newInstance() respect the strict_types=1 declaration at the attribute use-site. More generally, pretend that we are calling the attribute constructor from the place where the attribute is used, which also means that the attribute location will show up properly in backtraces and inside "called in" error information. This requires us to store the attributes strict_types scope (as flags), as well as the attribute line number. The attribute filename can be recovered from the symbol it is used on. We might want to expose the attribute line number via reflection as well. See also https://externals.io/message/111915. Closes GH-6201.
* Improve type declarations for Zend APIsGeorge Peter Banyard2020-08-281-2/+2
| | | | | | | | | Voidification of Zend API which always succeeded Use bool argument types instead of int for boolean arguments Use bool return type for functions which return true/false (1/0) Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics Closes GH-6002
* Implement named parametersNikita Popov2020-07-311-3/+8
| | | | | | | | | | | | | | | | | | From an engine perspective, named parameters mainly add three concepts: * The SEND_* opcodes now accept a CONST op2, which is the argument name. For now, it is looked up by linear scan and runtime cached. * This may leave UNDEF arguments on the stack. To avoid having to deal with them in other places, a CHECK_UNDEF_ARGS opcode is used to either replace them with defaults, or error. * For variadic functions, EX(extra_named_params) are collected and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS. RFC: https://wiki.php.net/rfc/named_params Closes GH-5357.
* Implement Attribute Amendments.Martin Schröder2020-06-291-19/+159
| | | | | | | | | RFC: https://wiki.php.net/rfc/attribute_amendments Support for attribute grouping is left out, because the short attribute syntax RFC will likely make it obsolete. Closes GH-5751.
* Fix free of uninitialized memory in attributesNikita Popov2020-06-071-0/+5
| | | | Fixes OSS-Fuzz #23140.
* Free attribute validators on shutdownNikita Popov2020-06-051-0/+5
|
* Add AttributesBenjamin Eberlei2020-06-041-0/+146
Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com>