History log of /PHP-8.4/Zend/zend_vm_def.h (Results 151 – 175 of 1935)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: php-8.0.3RC1, php-7.4.16RC1, php-8.0.2, php-7.4.15, php-7.3.27, php-8.0.2RC1, php-7.4.15RC2, php-7.4.15RC1, php-8.0.1, php-7.4.14, php-7.3.26, php-7.4.14RC1, php-8.0.1RC1, php-7.3.26RC1, php-8.0.0, php-7.3.25, php-7.4.13, php-8.0.0RC5, php-7.4.13RC1, php-8.0.0RC4, php-7.3.25RC1, php-7.4.12, php-8.0.0RC3, php-7.3.24, php-8.0.0RC2, php-7.4.12RC1, php-7.3.24RC1, php-7.2.34, php-8.0.0rc1, php-7.4.11, php-7.3.23, php-8.0.0beta4, php-7.4.11RC1, php-7.3.23RC1, php-8.0.0beta3, php-7.4.10, php-7.3.22, php-8.0.0beta2, php-7.3.22RC1, php-7.4.10RC1, php-8.0.0beta1, php-7.4.9, php-7.2.33, php-7.3.21, php-8.0.0alpha3, php-7.4.9RC1, php-7.3.21RC1, php-7.4.8, php-7.2.32, php-8.0.0alpha2, php-7.3.20, php-8.0.0alpha1, php-7.4.8RC1, php-7.3.20RC1, php-7.4.7, php-7.3.19, php-7.4.7RC1, php-7.3.19RC1
# 47a2e5c7 18-May-2020 Nikita Popov

Reference dynamic functions through dynamic_defs

Currently, dynamically declared functions and closures are inserted
into the function table under a runtime definition key, and then late

Reference dynamic functions through dynamic_defs

Currently, dynamically declared functions and closures are inserted
into the function table under a runtime definition key, and then later
possibly renamed. When opcache is not used and a file containing a
closure is repeatedly included, this leads to a very large memory leak,
as the no longer needed closure declarations will never be freed
(https://bugs.php.net/bug.php?id=76982).

With this patch, dynamic functions are instead stored in a
dynamic_func_defs member on the op_array, which opcodes reference
by index. When the parent op_array is destroyed, the dynamic_func_defs
it contains are also destroyed (unless they are stilled used elsewhere,
e.g. because they have been bound, or are used by a live closure). This
resolves the fundamental part of the leak, though doesn't completely
fix it yet due to some arena allocations.

The main non-obvious change here is to static variable handling:
We can't destroy static_variables_ptr in destroy_op_array, as e.g.
that would clear the static variables in a dynamic function when
the op_array containing it is destroyed. Static variable destruction
is separated out for this reason (we already do static variable
destruction separately for normal functions, so we only need to
handle main scripts).

Closes GH-5595.

show more ...


# 6dd85f83 22-Feb-2021 Nikita Popov

Fixed bug #80781

zend_find_array_dim_slow() may throw, make sure to handle this.
This backports the code we already use for this on PHP-8.0,
and also backports an exception check tha

Fixed bug #80781

zend_find_array_dim_slow() may throw, make sure to handle this.
This backports the code we already use for this on PHP-8.0,
and also backports an exception check that makes this easier to
catch.

show more ...


# 5d160e30 17-Feb-2021 Nikita Popov

Fix static variable behavior with inheritance

When a method is inherited, the static variables will now always
use the initial values, rather than the values at the time of
inheritan

Fix static variable behavior with inheritance

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.

show more ...


# 8b4ae72e 16-Feb-2021 Nikita Popov

Fix unused variable warning


# f8cf7152 16-Feb-2021 Dmitry Stogov

Microoptimization of STRLEN and IN_ARRAY opcodes (based on https://github.com/php/php-src/pull/4981)


# 8ffc20ac 13-Feb-2021 Tyson Andre

Optimize Traversable unpacking in zend_vm_def.h

The C compiler sees that a dynamic function is being called, so it cannot infer
that iter->funcs has not changed.

This results in

Optimize Traversable unpacking in zend_vm_def.h

The C compiler sees that a dynamic function is being called, so it cannot infer
that iter->funcs has not changed.

This results in more assembly instructions and slightly more time to execute that code
path.

Unpacking traversables to arrays(`ZEND_ADD_ARRAY_UNPACK`),
starting foreach loops (`ZEND_FE_FETCH*`), etc. are affected.

```
<?php
/*
* Before: 1.576 seconds
* After: 1.474 seconds
*/
function example() {
$start = hrtime(true);
$it = new SplFixedArray(1000);
$total = 0;
for ($i = 0; $i < 100000; $i++) {
$total += count([...$it]);
}
$end = hrtime(true);
printf("Elapsed: %.6f\n", ($end - $start) / 1_000_000_000);
}
example();
```

show more ...


# b10416a6 30-Nov-2020 Nikita Popov

Deprecate passing null to non-nullable arg of internal function

This deprecates passing null to non-nullable scale arguments of
internal functions, with the eventual goal of making the b

Deprecate passing null to non-nullable arg of internal function

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.

show more ...


# ef516481 10-Feb-2021 Dmitry Stogov

Use zend_type.ce_cache__ptr for caching class resulution during argument/result type checks


# 4b79dba9 09-Feb-2021 Dmitry Stogov

Added Inheritance Cache.

This is a new transparent technology that eliminates overhead of PHP class inheritance.

PHP classes are compiled and cached (by opcahce) separately, howeve

Added Inheritance Cache.

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.

show more ...


# 27cd7a11 07-Jan-2021 Nikita Popov

Add support for string keys in array unpacking

This adds support for:

$array1 = ['a' => 1, 'b' => 2];
$array2 = ['b' => 3, 'c' => 4];
$array = [...$array1, ...$a

Add support for string keys in array unpacking

This adds support for:

$array1 = ['a' => 1, 'b' => 2];
$array2 = ['b' => 3, 'c' => 4];
$array = [...$array1, ...$array2];
// => ['a' => 1, 'b' => 3, 'c' => 4]

RFC: https://wiki.php.net/rfc/array_unpacking_string_keys

Closes GH-6584.

show more ...


# b529d02d 26-Jan-2021 Dmitry Stogov

Allow observer handlers disabling optimization in RETURN opcode handler, that may cause loss value of returned local variable.


# a2dcd442 26-Jan-2021 Nikita Popov

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

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.

show more ...


# 776726da 26-Jan-2021 Nikita Popov

Add missing resource key warning for unset()

It was present on other operations, including isset(), but was
missing for unset().


# 3e01f5af 15-Jan-2021 Nikita Popov

Replace zend_bool uses with bool

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

Replace zend_bool uses with bool

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.

show more ...


# 9fc11762 11-Jan-2021 Dmitry Stogov

PHP array cannot refer to EG(symbol_table) any more. Replace corresponding checks by ZEND_ASSERT().


# 22793884 03-Dec-2020 Nikita Popov

Remove some INDIRECT handling in VM


# 3c68f38f 02-Dec-2020 Nikita Popov

Restrict allowed usages of $GLOBALS

This restricts allowed usage of $GLOBALS, with the effect that
plain PHP arrays can no longer contain INDIRECT elements.

RFC: https://wiki.ph

Restrict allowed usages of $GLOBALS

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.

show more ...


# 58d41b8c 11-Nov-2020 Sammy Kaye Powers

Provide unused retvals to observers

Make sure that the return value is available to observers, even if
it is not used by the caller.

Closes GH-6422.


# 855d8fa6 11-Nov-2020 Dmitry Stogov

[Observer] Save opline before calling begin/end handlers


# 1748b811 13-Oct-2020 Nikita Popov

Fix handling of throwing undef var in verify return

If we have an undefined variable and null is not accepted by the
return type, we want to throw just the undef var error.

In t

Fix handling of throwing undef var in verify return

If we have an undefined variable and null is not accepted by the
return type, we want to throw just the undef var error.

In this case this lead to an infinite loop, because we overwrite
the exception opline in SAVE_OPLINE and it does not get reset
when chaining into a previous exception. Add an assertiong to
catch this case earlier.

show more ...


# 304141e8 12-Oct-2020 Nikita Popov

Avoid non-object in FE_FREE

Even if the properties HT is empty, make sure we still leave an
object in the FE_RESET result, so our type inference results
stay correct.


# 15443f8a 09-Oct-2020 Nikita Popov

Fixed bug #80186

Early exit in FE_RESET if get_properties() returns empty array,
as we cannot add HT iterators to zend_empty_array.


# fd81e708 07-Oct-2020 Dmitry Stogov

Fixed incorrect behavior of observer API.

ZEND_HANDLE_EXCEPTION might call zend_observer_fcall_end() even if exception is cought by function. The fix moved zend_observer_fcall_end() into a r

Fixed incorrect behavior of observer API.

ZEND_HANDLE_EXCEPTION might call zend_observer_fcall_end() even if exception is cought by function. The fix moved zend_observer_fcall_end() into a right place and remove OBSERVER sepecialization for ZEND_HANDLE_EXCEPTION handler.

show more ...


# 773f980e 01-Oct-2020 Dmitry Stogov

Backport of a partial fix for bug Bug #76982 (memory leak declaring closure in included file).


# 2ee7e298 21-Sep-2020 George Peter Banyard

Promote count() warning to TypeError

Closes GH-6180


12345678910>>...78