| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This only moves the files, adjusts the build system, exports APIs
and does minor fixups to make sure the code builds.
This does not yet try to make the optimizer usable independently
of opcache.
Closes GH-6642.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Fix stub for Serializable::serialize()
|
| | |
| | |
| | |
| | | |
This method may also return null.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Observe fake closures
|
| | |
| | |
| | |
| | | |
Closes GH-6607.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Allow observer handlers disabling optimization in RETURN opcode handler, that may cause loss value of returned local variable.
|
| | |
| | |
| | |
| | | |
that may cause loss value of returned local variable.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Skip dummy frames allocated on CPU stack of zend_call_function(). (Usage of "current_observed_frame" varible looks unsafe to me).
|
| | |
| | |
| | |
| | | |
(Usage of "current_observed_frame" varible looks unsafe to me).
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Fix VAR return type verification
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We should also set retval_ref when de-indirecting. Otherwise the
retval_ref != retval_ptr comparison below may incorrect assume
that we're returning a reference.
I don't have a reliable reproducer for this issue, but it sometimes
appears in certain configurations in arrow_functions/007.phpt in
conjunction with other changes.
|
| | |
| | |
| | |
| | |
| | | |
It was present on other operations, including isset(), but was
missing for unset().
|
| | |
| | |
| | |
| | |
| | |
| | | |
Closes GH-6289
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Improve switch continue warning
|
| | |
| | |
| | |
| | |
| | | |
Don't suggest "continue N+1" if there is no wrapping loop. The
resulting code would be illegal.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
To avoid increasing the size of parser stack elements by storing
size_t offset and length, this instead only stores the start
offset (or rather pointer now) and determines the length of the
identifier in zend_lex_tstring.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Print "Cannot use empty array entries in keyed array assignment"
instead of "Cannot mix keyed and unkeyed array entries in assignments"
for a leading comma.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This function tests if an array contains only sequential integer keys. While
list isn't an official type, this usage is consistent with the community usage
of "list" as an annotation type, cf.
https://psalm.dev/docs/annotating_code/type_syntax/array_types/#lists
Rebased and modified version of #4886
- Use .stub.php files
- Add opcache constant evaluation when argument is a constant
- Change from is_list(mixed $value) to array_is_list(array $array)
RFC: https://wiki.php.net/rfc/is_list
Co-Authored-By: Tyson Andre <tysonandre775@hotmail.com>
Co-Authored-By: Dusk <dusk@woofle.net>
Closes GH-6070
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The extension name should match the name of the ext/ directory,
otherwise it will not get picked up by run-tests. It would be possible
to remap this in run-tests, but I think it's better to rename the
extension to follow the standard format. Other extensions also
use underscore instead of hyphen (e.g. pdo_mysql and not pdo-mysql).
Of course, the ./configure option remains hyphenated.
Closes GH-6613.
|
| | |
| | |
| | |
| | | |
copying and desrpoying of immutable data.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The comment is outdated as of PHP7.
For example, in the current code, zend_assign_op_overloaded_property() expects the refcount of the returned value from read_property to be greater than 0 when the returned value is a refcounted, to call zval_ptr_dtor() later.
History:
- The same description was originally written in a commit in 2004 alongside the write side. https://github.com/php/php-src/commit/c8c0e979826b677de5f786920289056242ea5c54
- One requested to put the description in somewhere. https://externals.io/message/7789
- Then it was added as a comment in zend_object_handler.h . https://github.com/php/php-src/commit/7d3215d33321173c58db4d86b7398e16c5c55d13
- At the time the comment was written, there were at least three places where the code actually set the reference count to 0 in read_properties.
- https://github.com/php/php-src/blob/7d3215d33321173c58db4d86b7398e16c5c55d13/ext/dom/php_dom.c#L229
- https://github.com/php/php-src/blob/7d3215d33321173c58db4d86b7398e16c5c55d13/ext/mysqli/mysqli.c#L190
- https://github.com/php/php-src/blob/7d3215d33321173c58db4d86b7398e16c5c55d13/ext/simplexml/simplexml.c#L245
- All three of the above were removed during the development of PHP 7.
- https://github.com/php/php-src/commit/2f0a758fbbf39ff8684d167f86c708cc361db782
- https://github.com/php/php-src/commit/2402d6cbbc5e04362b23b183f9129a8db230bcce
- https://github.com/php/php-src/commit/a975c7e0fe95a94c119eb1c8e519b2357aa50dcc
- In the current code, even when they generate and return a refcounted value, its refcount would be 1.
Closes GH-6618.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
I've previously addressed the case of assignments, but the same
issue exists for isset and unset.
Fixes oss-fuzz #29699.
|
| | |
| | |
| | |
| | | |
Fixes oss-fuzz #29389.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This function is unused in php-src, and has somewhat dubious
semantics, especially since we switched convert_to_long to not
use strtol for the base 10 case.
If you want to convert strings from a different base, use
ZEND_STRTOL directly.
|
| | |
| | |
| | |
| | |
| | |
| | | |
This function is unused, and also not particularly useful now that
PHP no longer prints doubles in a locale-sensitive way unless
someone really goes out of their way to force it.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Historically, the _ex variants separated the zval first, if a
conversion was necessary. This distinction no longer makes sense
since PHP 7.
The only difference that was still left is that _ex checked whether
the type is the same first, but the usage of these macros did not
actually distinguish on whether such an inlined check is valuable
or not in a given context.
Also drop the unused convert_to_explicit_type macros.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Separation can only possibly make sense for array parameters
(or something that can contain arrays, like zval parameters). It
never makes sense to separate a bool.
The deref parameters are also of dubious utility, but leaving them
for now.
|
| | |
| | |
| | |
| | |
| | | |
This macro hasn't made sense since PHP 7. The correct pattern to
use is ZVAL_DEREF + SEPARATE_ZVAL_NOREF.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The name doesn't correspond to what it does at all, and all the
existing usages appear to be unnecessary.
Usage of this macro can be replaced by ZVAL_DEREF + Z_TRY_ADDREF_P.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Fixed bug #80617: Type narrowing warning in ZEND_TYPE_INIT_CODE
|
| | | |
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Fixed bug #80596: Fix anonymous class union typehint errors
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Cut off part after null byte when resolving the class name, to
avoid cutting off a larger part lateron.
Closes GH-6601.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The same description was originally written in a commit in 2004 which fixes a bug in the pre-released simplexml.
https://github.com/php/php-src/commit/c8c0e979826b677de5f786920289056242ea5c54
One requested to put the description in somewhere.
https://externals.io/message/7789
Then it was added as a comment in zend_object_handler.h .
https://github.com/php/php-src/commit/7d3215d33321173c58db4d86b7398e16c5c55d13
At the time of the comment written, the refcount of RHS was simply incremented before calling the write handler in the process of ZEND_ASSIGN_OBJ.
https://github.com/php/php-src/blob/c8c0e979826b677de5f786920289056242ea5c54/Zend/zend_execute.c#L407
The refcount of a zval may be 0 or 1 if the write handler is called from zend_API in that era.
https://github.com/php/php-src/blob/c8c0e979826b677de5f786920289056242ea5c54/Zend/zend_API.c#L1058-L1170
The original fix in simplexml was removed in 2018, because scalar types don't have reference counter anymore as of PHP7.
https://github.com/php/php-src/commit/f7f790fcc9d57bcd0b6d356994c67ec746a5ac23
https://github.com/php/php-src/commit/4a475a4976db92e71949786cdf5990c61514261e
It seems that the original intent of this prescription was preventing unintended modification to the RHS and values which share the memory location with the RHS in assignments.
In the first place, it is not usual trying to change the RHS in a write handler, IMHO. I don't think the description makes sense in the current situation about handling of refcount, so I simply delete the whole sentences.
Because write_dimension has no return value, the mentioning about the return value is moved to the comment for write_property only.
Closes GH-6597.
|
| | | |
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* 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.
|
| | |
| | |
| | |
| | | |
checks by ZEND_ASSERT().
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This restricts allowed usage of $GLOBALS, with the effect that
plain PHP arrays can no longer contain INDIRECT elements.
RFC: https://wiki.php.net/rfc/restrict_globals_usage
Closes GH-6487.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Fix infinite recursion in unlinked_instanceof
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
I suspect this is only a partial fix for the issue, it's probably
possible to recurse through a more complex pathway as well.
Fixes oss-fuzz #28961.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We'd call strtol starting at the whitespace, and strtol strips
whitespace...
Fixes oss-fuzz #29272.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
RFC: https://wiki.php.net/rfc/explicit_octal_notation
Add an extensive test suits for other variants of integer literals
Closes GH-6360
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In some cases, like spl_object_id, the code is simpler but equally efficient
after optimizations.
In other cases, like get_mangled_object_vars(), the compiler can't infer that
the object in the zval won't change.
Closes GH-6567
|