| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
This closes the last hole in the supported types for internal
function arginfo types. It's now possible to represent unions of
multiple classes. This is done by storing them as TypeA|TypeB and
PHP will then convert this into an appropriate union type list.
Closes GH-6581.
|
|
|
|
|
|
| |
Export the zend_is_callable_impl() function as
zend_is_callable_at_frame() for use by extension. As twose pointed
out, an extension may want to retrieve fcc for a private method.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of setting the old AST type to zero, replace the AST with
the compiled constexpr AST zval. This requires passing in a
zend_ast** instead of a zend_ast*.
This allows compiling ASTs containing constexprs multiple times
-- the second time, the existing compiled representation will be
resused.
This means we no longer need to copy the attributes AST for
promoted properties.
|
|
|
|
| |
Fixes a crash in Symfony SecurityBundle tests.
|
|
|
|
|
|
| |
Closes GH-6081
Co-Authored-By: Nikita Popov <nikic@php.net>
|
|
|
|
|
|
|
| |
They will now follow the canonical order of types. Older macros are
left intact due to maintaining BC.
Closes GH-6112
|
|
|
|
| |
Closes GH-5999
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we treat paths with null bytes as a TypeError, which is
incorrect, and rather inconsistent, as we treat empty paths as
ValueError. We do this because the error is generated by zpp and
it's easier to always throw TypeError there.
This changes the zpp implementation to throw a TypeError only if
the type is actually wrong and throw ValueError for null bytes.
The error message is also split accordingly, to be more precise.
Closes GH-6094.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using zpp 'f' or Z_PARAM_FUNC, if the fcc points to a call
trampoline release it immediately and force zend_call_function
to refetch it. This may require additional callability checks
if __call is used, but avoids the need to carefully free fcc
values in all internal functions -- in some cases this is not
simple, as a type error might be triggered by a later argument
in the same zpp call.
This fixes oss-fuzz #25390.
Closes GH-6073.
|
|\
| |
| |
| |
| |
| |
| |
| | |
* PHP-7.4:
Improve error_handing replacement functions
# Conflicts:
# Zend/zend_API.c
|
| |\
| | |
| | |
| | |
| | | |
* PHP-7.3:
Improve error_handing replacement functions
|
| | |
| | |
| | |
| | |
| | |
| | | |
We explicitly skip calls to user_error_handler in EH_THROW mode
Closes GH-6050.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
To perform fast shutdown without full table cleanup we need all
internal functions to be in one continuous chunk. This was
violated when functions were deleted via disable_functions.
This drops the zend_disable_function() API in favor of
zend_disable_functions(), which disables the given list of
functions and performs the necessary rehash afterwards.
Also drop PG(disabled_functions), which is no longer used.
|
| | |
| | |
| | |
| | | |
Variadic functions do not support the fastcall calling convention.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | | |
Closes GH-6039.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Set HAS_TYPE_HINTS flag if the variadic parameter is types as well,
and make sure it has a distinct name. This was previously missed,
because the variadic parameter is not part of num_args.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Refactor the zend_is_callable implementation to check callability
at a particular frame (this is an implementation detail for now,
but could be exposed in the API if useful). Pick the first parent
user frame as the one to check.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
If the expected return type of a magic method is "object", we also
need to allow class types and "static" to comply with covariance.
|
| | |
| | |
| | |
| | |
| | | |
This fixes one of the issues reported in bug #79925. The parameter
type check for this particular method was missed.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | | |
This was repeated three times.
|
| | |
| | |
| | |
| | | |
Instead of going through intermediary variables.
|
| | |
| | |
| | |
| | | |
This is probably a leftover from "old style constructor" support.
|
| | |
| | |
| | |
| | |
| | | |
Report the name the way the user has written it, the same way we
always do.
|
| | |
| | |
| | |
| | | |
This was missing entirely for the internal function case.
|
| | | |
|
| | |
| | |
| | |
| | | |
And promote it to be fatal.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Let everything go through a common function, which fixes some
consistency issues.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
uint32_t type for argument count
size_t for length of char*
zend_bool for a zval bool arg
Closes GH-5845
|
| | |
| | |
| | |
| | | |
Closes GH-5590
|
| | |
| | |
| | |
| | | |
Closes GH-5831.
|
| | |
| | |
| | |
| | | |
Closes GH-5805
|
| | | |
|
| | |
| | |
| | |
| | | |
Closes GH-5788
|
| | |
| | |
| | |
| | |
| | | |
We should use these cache slots for the new object serialization
mechanism rather than the old one.
|
| | |
| | |
| | |
| | | |
Closes GH-5687
|
| | |
| | |
| | |
| | | |
Closes GH-5676.
|
| | |
| | |
| | |
| | | |
Close GH-5675.
|
| | |
| | |
| | |
| | | |
Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is a private property, so we are allowed to add a type.
The new declaration of the property is:
private array $trace = [];
This ensures that Exception::getTrace() does indeed return an array.
Userland code that was modifying the property through refleciton
may have to be adjusted to assign an array (instead of null,
for example).
Closes GH-5636.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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-5609
|