| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
| |
| |
| |
| | |
Closes GH-5917
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| | |
Related to GH-5627
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
RFC: https://wiki.php.net/rfc/saner-numeric-strings
This removes the -1 allow_error mode from is_numeric_string functions and replaces it by
a trailing boolean out argument to preserve BC in a couple of places.
Most of the changes can be resumed to "numeric" strings which emitted a E_NOTICE now emit
a E_WARNING and "numeric" strings which emitted a E_WARNING now throw a TypeError.
This mostly affects:
- String offsets
- Arithmetic operations
- Bitwise operations
Closes GH-5762
|
| | |
|
| |
| |
| |
| | |
Closes GH-5850
|
| | |
|
| |
| |
| |
| |
| |
| | |
RFC: https://wiki.php.net/rfc/string_to_number_comparison
Closes GH-3886.
|
| |
| |
| |
| | |
This class is not safe against malicious extension / instantiation.
|
| |
| |
| |
| |
| |
| | |
Bug that regularly sneaks in: ZEND_ACC_FINAL is set before calling
zend_register_internal_class() and promptly gets ignored. Remove
this footgun by preserving flags from the original CE.
|
| | |
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fixed bug #79820
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, unexpected tokens in the parser are shown as the text
found, plus the internal token name, including the notorious
"unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM)".
This commit replaces that with a more user-friendly format, with
two main types of token:
* Tokens which always represent the same text are shown like
'unexpected token "::"' and 'expected "::"'
* Tokens which have variable text are given a user-friendly
name, and show like 'unexpected identifier "foo"', and
'expected identifer'.
A few tokens have special cases:
* unexpected token """ -> unexpected double-quote mark
* unexpected quoted string "'foo'" -> unexpected single-quoted
string "foo"
* unexpected quoted string ""foo"" -> unexpected double-quoted
string "foo"
* unexpected illegal character "_" -> unexpected character 0xNN
(where _ is almost certainly a control character, and NN is the
hexadecimal value of the byte)
The \ token has a special case in the implementation just to stop
bison making a mess of escaping it and it coming out as \\
|
| |
| |
| |
| | |
Closes GH-5590
|
| | |
|
| |
| |
| |
| | |
Closes GH-5758
|
| | |
|
| | |
|
| |
| |
| |
| | |
Exposed in Symfony due to exit changes.
|
| |
| |
| |
| | |
Closes GH-5779
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Closes GH-5759
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix #69804: ::getStaticPropertyValue() throws on protected props
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`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.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix #79487: ::getStaticProperties() ignores property modifications
|
| |
| |
| |
| |
| | |
When retrieving the static class properties via reflection, we have to
cater to possible modifications.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The hash is used to check whether the arginfo file needs to be
regenerated. PHP-Parser will only be downloaded if this is actually
necessary.
This ensures that release artifacts will never try to regenerate
stubs and thus fetch PHP-Parser, as long as you do not modify any
files.
Closes GH-5739.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Revert "Fix #79487: ::getStaticProperties() ignores property modifications"
|
| |
| |
| |
| | |
This reverts commit a895bb6885fbceea3e8375816969d5510d8d082e.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix #79487: ::getStaticProperties() ignores property modifications
|
| |
| |
| |
| |
| | |
When retrieving the static class properties via reflection, we have to
cater to possible modifications.
|
| |
| |
| |
| |
| | |
For the common ZVAL_OBJ + GC_ADDREF pattern.
This mirrors the existing ZVAL_STR_COPY API.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds the following APIs:
void zend_call_known_function(
zend_function *fn, zend_object *object, zend_class_entry *called_scope,
zval *retval_ptr, int param_count, zval *params);
void zend_call_known_instance_method(
zend_function *fn, zend_object *object, zval *retval_ptr, int param_count, zval *params);
void zend_call_known_instance_method_with_0_params(
zend_function *fn, zend_object *object, zval *retval_ptr);
void zend_call_known_instance_method_with_1_params(
zend_function *fn, zend_object *object, zval *retval_ptr, zval *param);
void zend_call_known_instance_method_with_2_params(
zend_function *fn, zend_object *object, zval *retval_ptr, zval *param1, zval *param2);
These are used to perform a call if you already have the
zend_function you want to call. zend_call_known_function()
is the base API, the rest are just really thin wrappers around
it for the common case of instance method calls.
Closes GH-5692.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fixed bug #79683
|
| |
| |
| |
| |
| |
| |
| | |
Reset fake_scope during __toString() call.
I'll check if we can solve this more globally in master, by
resetting fake_scope in zend_call_function.
|
| |
| |
| |
| | |
Closes GH-5682.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This solves [#79628](https://bugs.php.net/79628).
Similar to `ReflectionClass::getMethods()` and `ReflectionClass::getProperties()`,
this new `$filter` argument allows the filtering of constants defined in a class by
their visibility.
For that, we create three new constants for `ReflectionClassConstant`:
* `IS_PUBLIC`
* `IS_PROTECTED`
* `IS_PRIVATE`
Closes GH-5649.
|
| | |
|
| |
| |
| |
| | |
Close GH-5675.
|
| |
| |
| |
| |
| |
| | |
RFC: https://wiki.php.net/rfc/constructor_promotion
Closes GH-5291.
|
| |
| |
| |
| | |
Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com>
|
| |
| |
| |
| |
| |
| | |
all types
Closes GH-56430
|
| |
| |
| |
| |
| |
| |
| | |
From now on, we always display the given object's type instead of just reporting "object".
Additionally, make the format of return type errors match the format of argument errors.
Closes GH-5625
|
| |
| |
| |
| | |
Closes GH-5618
|
| |
| |
| |
| |
| |
| |
| | |
RFC: https://wiki.php.net/rfc/mixed_type_v2
Closes GH-5313
Co-authored-by: Dan Ackroyd <danack@basereality.com>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This deprecates:
ReflectionParameter::isArray()
ReflectionParameter::isCallable()
ReflectionParameter::getClass()
These APIs have been superseded by ReflectionParameter::getType()
since PHP 7.0. Types introduced since that time are not available
through the old APIs, and their behavior is getting increasingly
confusing. This is how they interact with PHP 8 union types:
* isArray() will return true if the type is array or ?array,
but not any other union type
* Same for isCallable().
* getClass() will return a class for T|int etc, as long as the
union only contains a single type. T1|T2 will return null.
This behavior is not particularly reasonable or useful, and will
get more confusing as new type system extensions are added.
Closes GH-5209.
|