| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
RFC: https://wiki.php.net/rfc/enumerations
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
Closes GH-6489.
|
|\ |
|
| |\ |
|
| | |
| | |
| | |
| | | |
calling __construct after instantiation
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When a method is inherited, the static variables will now always
use the initial values, rather than the values at the time of
inheritance. As such, behavior no longer depends on whether
inheritance happens before or after a method has been called.
This is implemented by always keeping static_variables as the
original values, and static_variables_ptr as the modified copy.
Closes GH-6705.
|
| | |
| | |
| | |
| | |
| | |
| | | |
reflection, session, shmop
Closes GH-6692
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is a new transparent technology that eliminates overhead of PHP class inheritance.
PHP classes are compiled and cached (by opcahce) separately, however their "linking" was done at run-time - on each request. The process of "linking" may involve a number of compatibility checks and borrowing methods/properties/constants form parent and traits. This takes significant time, but the result is the same on each request.
Inheritance Cache performs "linking" for unique set of all the depending classes (parent, interfaces, traits, property types, method types involved into compatibility checks) once and stores result in opcache shared memory. As a part of the this patch, I removed limitations for immutable classes (unresolved constants, typed properties and covariant type checks). So now all classes stored in opcache are "immutable". They may be lazily loaded into process memory, if necessary, but this usually occurs just once (on first linking).
The patch shows 8% improvement on Symphony "Hello World" app.
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
We cannot `RETURN_THROWS()` here, since `return_value` is not defined.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
If `zval_update_constant_ex()` fails, an exception has already been
thrown, so we clarify that in the implementation as well.
Closes GH-6557.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix usage of casted string in ReflectionParameter ctor
|
| |
| |
| |
| | |
Fixes oss-fuzz #27755.
|
| |
| |
| |
| | |
Closes GH-6428.
|
| |
| |
| |
| |
| | |
The default value is part of the op_array in that case, but we have
no way to access it. Fail gracefully.
|
| |
| |
| |
| |
| |
| |
| | |
This reverts commit ef6adb4e27853eb19bf50bad6486311920d6af7b.
Per Ondrej's comment, this is already being used by BetterReflection
adaptors, ugh.
|
| |
| |
| |
| | |
Closes GH-6384
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Closes GH-6173
|
| |
| |
| |
| |
| |
| |
| | |
ReflectionReference::fromArrayElement(array $array, int|string $key): ?ReflectionReference
is going to be its official signature for PHP 8.0.
Closes GH-5651
|
| |
| |
| |
| |
| |
| |
| | |
They will now follow the canonical order of types. Older macros are
left intact due to maintaining BC.
Closes GH-6112
|
| |
| |
| |
| | |
Closes GH-6098
|
| |
| |
| |
| | |
We can add these types as a native type declaration to stubs as a side-effect. Closes GH-6068
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix leak on consteval exception in ReflectionClass::__toString()
|
| | |
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Check update constant failure in ReflectionClassConstant::__toString()
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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" in the sense of "not crash". We aren't able to actually
display the default value for this case, as there's no way to
fetch the relevant information right now.
|
| | |
|
| | |
|
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
Closes GH-5850
|
| |
| |
| |
| | |
This class is not safe against malicious extension / instantiation.
|
| |
| |
| |
| | |
Closes GH-5590
|
| | |
|
| |
| |
| |
| | |
Closes GH-5758
|
| | |
|
| |
| |
| |
| | |
Exposed in Symfony due to exit changes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| |/
| |
| |
| | |
* 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
|