| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This if branch seems to be a remain of when certain type errors where E_WARNINGs, something which isn't the case since PHP 8.0.
|
|
|
|
| |
Thet search for an element with given key/index and add an empty one (NULL), if no found.
|
|
|
|
|
|
| |
We have separate flags for non-autoloading class fetches and
silent class fetches. There's no reason why NO_AUTOLOAD should
be special-cased to be implicitly silent.
|
|
|
|
|
| |
This allows to eliminate re-calculation of string lenght and hash value.
See the detailed list of changes in UPGRADING.INTERNALS.
|
| |
|
|
|
|
|
|
| |
If an internal class overrides read_property and declared property
types, make sure that the returned value matches the declared
type (in debug builds).
|
|\
| |
| |
| |
| | |
* PHP-8.0:
Fixed bug #80811
|
| |
| |
| |
| |
| | |
When filling in defaults for skipped params, make sure that
reference parameters get the expected reference wrapper.
|
|\ \
| |/
| |
| |
| | |
* PHP-8.0:
Fix trampoline leak on dynamic static call of non-static method
|
| |
| |
| |
| | |
Fixes oss-fuzz #30317.
|
|\ \
| |/
| |
| |
| | |
* PHP-8.0:
Fix symtable cache being used while cleaning symtable
|
| |\
| | |
| | |
| | |
| | | |
* PHP-7.4:
Fix symtable cache being used while cleaning symtable
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We need to first clean the symtable and then check whether a cache
slot is available for it. Otherwise, it may happen that a destructor
runs while cleaning the table and uses up all the remaining slots
in the cache.
This is particularly insidious because once we overflow the cache,
the first pointer we modify is symtable_cache_ptr, making it hard
to understand what happened after the fact.
Fixes oss-fuzz #30815.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This deprecates passing null to non-nullable scale arguments of
internal functions, with the eventual goal of making the behavior
consistent with userland functions, where null is never accepted
for non-nullable arguments.
This change is expected to cause quite a lot of fallout. In most
cases, calling code should be adjusted to avoid passing null. In
some cases, PHP should be adjusted to make some function arguments
nullable. I have already fixed a number of functions before landing
this, but feel free to file a bug if you encounter a function that
doesn't accept null, but probably should. (The rule of thumb for
this to be applicable is that the function must have special behavior
for 0 or "", which is distinct from the natural behavior of the
parameter.)
RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg
Closes GH-6475.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Don't throw additional Error in require_once if exception already thrown
|
| | |
| | |
| | |
| | | |
As pointed out in comments on bug #66216.
|
| | |
| | |
| | |
| | | |
argument/result type checks
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | | |
* PHP-8.0:
Use E_ERROR to report arginfo/zpp mismatch
Make NumberFormatter ctor $pattern nullable
Make IntlDateFormatter ctor $pattern nullable
|
| | |
| | |
| | |
| | | |
When E_CORE_ERROR is used, we don't get correct file/line information.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Add support for union types for internal functions
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This is an unavoidable breaking change to both the type and
parameter name.
The assertion that was supposed to prevent this was overly lax
and accepted any object type for string parameters.
|
| |
| |
| |
| |
| |
| |
| | |
Missed a check for info in this code. Add it, and add an assertion
in type source removal to make it easier to catch this issue.
Fixes oss-fuzz #28208 and #28257.
|
| |
| |
| |
| | |
prologue/epilogue.
|
| |
| |
| |
| | |
Fixes oss-fuzz #26763.
|
| |
| |
| |
| |
| |
| | |
See also https://externals.io/message/112083.
Closes GH-6364.
|
| |
| |
| |
| |
| |
| | |
The `zend_system_id` is a (true global) system ID that fingerprints a process state. When extensions add engine hooks during MINIT/startup, entropy is added the system ID for each hook. This allows extensions to identify that changes have been made to the engine since the last PHP process restart.
Closes GH-5871
|
| |
| |
| |
| |
| |
| | |
This is an annoying edge case that regularly gets broken. As we're
not aware of significant users of this API, and there are other
ways to hook this, remove support for EXT_NOP.
|
| |
| |
| |
| | |
Skip over leading EXT_NOP, if it exists.
|
| |
| |
| |
| | |
Fixes oss-fuzz #25676.
|
| | |
|
| |
| |
| |
| |
| | |
We shouldn't assume that call->prev_execute_data is NULL here. The
value needs to be preserved for call chains.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If an argument error refers to a variadic argument, we normally
do not print the name of the variadic (as it is not referring to
an individual argument, but to the collection of all of them).
However, this was not the case for the userland argument type
error message, which did it's own formatting.
Closes GH-6101.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Closes GH-5999
|
| |
| |
| |
| |
| | |
This error condition is handled separately, never reaches this
function.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Shift the responsibility for emitting MAKE_REF to the list assignment
code, to make sure that LIST_W and MAKE_REF are directly adjacent,
and there are no opcodes in between that could modify the LIST_W
result.
Additionally, adjust the zend_wrong_string_offset() code to not
perform a loop over opcodes and assert that the next opcode is
a relevant one. The VM write-safety model requires this.
This is a followup to a07c1f56aac1c0f6c8334760009b678cbf9d6138
and the full fix for oss-fuzz #25352.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix infinite loop on string offset during by-ref list assign
|
| |\
| | |
| | |
| | |
| | | |
* PHP-7.3:
Fix infinite loop on string offset during by-ref list assign
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
There is a deeper underlying issue here, in that the opcodes violate
VM write-fetch safety, but let's fix the infinite loop first.
This fixes oss-fuzz #25352.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Closes GH-5857.
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
Co-authored-by: Sammy Powers <sammyk@datadoghq.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
And do the check before increfing the closure object, otherwise
we'd have to release it as well.
Fixes oss-fuzz #25313.
|
| | |
| | |
| | |
| | |
| | | |
zend_verify_type_error_common() no longer needs the cache_slot,
so drop it there and from all users.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | | |
We're only creating tmp here to compare against the existing
coerced_value. We need to destroy it in all cases.
|