Nikita Popov [Wed, 11 Dec 2019 12:06:10 +0000 (13:06 +0100)]
Fixed bug #78903: Conflict in RTD key for closures results in crash
I wasn't able to create a simple reproducer for this. General approach
is the same as for anonymous classes: If the key is already used, reuse
the old definition.
Tyson Andre [Sat, 7 Dec 2019 15:09:32 +0000 (10:09 -0500)]
Speed up array_intersect/array_diff/array_filter
Use zend_hash_update instead of zend_hash_add.
These are taking a subset of keys from an array with unique keys,
so the result should also have unique keys.
(this is already done for array_map())
Also, speed up array_intersect and array_diff slightly by
using ZEND_HASH_FOREACH macros.
This way, it doesn't need to load the same buckets and array counts
from memory every time (compiler previously couldn't infer they won't change)
```php
<?php
// $n=10000 now takes 0.095 seconds instead of 0.102
function test_bench(int $n) {
$values = range(0,1000);
$other = range(0,1000);
unset($other[500]);
unset($values[400]);
Nikita Popov [Tue, 10 Dec 2019 12:49:40 +0000 (13:49 +0100)]
Fix release build failure
GCC complained about potentially uninitialized __orig_bailout,
even though the variable has an initializer. This warning was
quite persistent, I was only able to avoid it by using a separate
function.
Nikita Popov [Mon, 9 Dec 2019 14:14:39 +0000 (15:14 +0100)]
Fixed bug #78935: Check that all linked classes can be preloaded
During preloading, check that all classes that have been included
as part of the preload script itself (rather than through opcache_compile_file)
can actually be preloaded, i.e. satisfy Windows restrictions, have
resolved initializers and resolved property types. When resolving
initializers and property types, also autoload additional classes.
Because of this, the resolution runs in a loop.
Dmitry Stogov [Mon, 9 Dec 2019 12:07:39 +0000 (15:07 +0300)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Call zend_unregister_ini_entries() when unload extension loaded through dl() without MSHUTDOWN callback. Extensions with MSHUTDOWN should use UNREGISTER_INI_ENTRIES().
Dmitry Stogov [Mon, 9 Dec 2019 12:05:24 +0000 (15:05 +0300)]
Call zend_unregister_ini_entries() when unload extension loaded through dl() without MSHUTDOWN callback.
Extensions with MSHUTDOWN should use UNREGISTER_INI_ENTRIES().
Due to former restrictions of the libcurl API, curl multipart/formdata
file uploads supported only proper files. However, as of curl 7.56.0
the new `curl_mime_*()` API is available (and already supported by
PHP[1]), which allows us to support arbitrary *seekable* streams, which
is generally desirable, and particularly resolves issues with the
transparent Unicode and long part support on Windows (see bug #77711).
Note that older curl versions are still supported, but CURLFile is
still restricted to proper files in this case.
Nikita Popov [Mon, 9 Dec 2019 08:15:27 +0000 (09:15 +0100)]
Fixed bug #78926: Handle class table reallocation on failed link
When we change back the bucket key on a class linking failure,
make sure to reload the bucket pointer, as the class table may
have been reallocated in the meantime.
Also remove a bogus bucket key change in anon class registration:
We don't actually rename the class in this case anymore, the RTD
key is already the final name.
Nikita Popov [Mon, 28 Oct 2019 12:34:33 +0000 (13:34 +0100)]
Fixed bug #78904: Don't call any magic for uninitialized typed properties
We already changed the behavior for __set() in f1848a4. However, it
seems that this is also a problem for all the other property magic,
see bug #78904.
This commit makes the behavior of all the property magic consistent:
Magic will not be triggered for uninitialized typed properties, only
explicitly unset() ones. This brings behavior more in line how
non-typed properties behave and avoids WTF.
Drop duplicate definitions of zend_isnan and friends
Following up on commit 1c4ad17[1], we remove these definitions from
zend_config.w32.h, since they would be overridden by those in
zend_portability.h anyway.
Nikita Popov [Fri, 6 Dec 2019 10:07:57 +0000 (11:07 +0100)]
Fix constant evaluation of && and ||
The "return" in the for loop should have been a break on the switch,
otherwise the result is just ignored... but because it prevents
evaluation of the other operand, it also violates the invariant that
everything has been constant evaluated, resulting in an assertion
failure.
The for loop isn't correct in any case though, because it's not legal
to determine the result based on just the second operand, as the
first one may have a side-effect that cannot be optimized away.
Nikita Popov [Thu, 5 Dec 2019 14:01:51 +0000 (15:01 +0100)]
Remove CV limitation when determining value from type in SCCP
As far as I can determine, this is no longer a problem: We will
not try to remove the defining instructions (this is only done if
the value is known by SCCP itself) and we also only determine
non-refcounted values in this way, so it is not a problem if the
FREE is omitted.