2015-07-21 22:36:36 +08:00
|
|
|
PHP NEWS
|
1999-07-23 07:54:54 +08:00
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
2023-07-19 06:54:56 +08:00
|
|
|
?? ??? ????, PHP 8.3.0beta2
|
|
|
|
|
2023-07-26 20:48:50 +08:00
|
|
|
- Bcmath
|
|
|
|
. Fixed GH-11761 (removing trailing zeros from numbers) (jorgsowa)
|
|
|
|
|
2023-07-25 05:23:32 +08:00
|
|
|
- Core:
|
|
|
|
. Fixed oss-fuzz #60741 (Leak in open_basedir). (ilutov)
|
|
|
|
|
2023-07-26 04:22:01 +08:00
|
|
|
- DOM:
|
|
|
|
. Fixed bug GH-11792 (LIBXML_NOXMLDECL is not implemented or broken).
|
|
|
|
(nielsdos)
|
|
|
|
|
2023-07-20 19:28:02 +08:00
|
|
|
- FFI:
|
|
|
|
. Fix leaking definitions when using FFI::cdef()->new(...). (ilutov)
|
2023-07-19 05:30:49 +08:00
|
|
|
|
2023-07-18 18:01:57 +08:00
|
|
|
- Streams:
|
|
|
|
. Fixed bug GH-11735 (Use-after-free when unregistering user stream wrapper
|
|
|
|
from itself). (ilutov)
|
2023-07-19 06:54:56 +08:00
|
|
|
|
|
|
|
20 Jul 2023, PHP 8.3.0beta1
|
2023-07-05 18:05:05 +08:00
|
|
|
|
2023-02-26 22:06:35 +08:00
|
|
|
- CLI:
|
|
|
|
. Implement GH-10024 (support linting multiple files at once using php -l).
|
|
|
|
(nielsdos)
|
2023-07-05 18:05:05 +08:00
|
|
|
|
2023-06-27 01:08:52 +08:00
|
|
|
- Core:
|
2023-07-05 19:16:32 +08:00
|
|
|
. Fixed line number of JMP instruction over else block. (ilutov)
|
Fix use-of-uninitialized-value with ??= on assert
Normally, PHP evaluates all expressions in offsets (property or array), as well
as the right hand side of assignments before actually fetching the offsets. This
is well explained in this blog post.
https://www.npopov.com/2017/04/14/PHP-7-Virtual-machine.html#writes-and-memory-safety
For ??= we have a bit of a problem in that the rhs must only be evaluated if the
lhs is null or undefined. Thus, we have to first compile the lhs with BP_VAR_IS,
conditionally run the rhs and then re-fetch the lhs with BP_VAR_W to to make
sure the offsets are valid if they have been invalidated.
However, we don't want to just re-evaluate the entire lhs because it may contain
side-effects, as in $array[$x++] ??= 42;. In this case, we don't want to
re-evaluate $x++ because it would result in writing to a different offset than
was previously tested. The same goes for function calls, like
$array[foo()] ??= 42;, where the second call to foo() might result in a
different value. PHP behaves correctly in these cases. This is implemented by
memoizing sub-expressions in the lhs of ??= and reusing them when compiling the
lhs for the second time. This is done for any expression that isn't a variable,
i.e. anything that can (potentially) be written to.
Unfortunately, this also means that function calls are considered writable due
to their return-by-reference semantics, and will thus not be memoized. The
expression foo()['bar'] ??= 42; will invoke foo() twice. Even worse,
foo(bar()) ??= 42; will call both foo() and bar() twice, but
foo(bar() + 1) ??= 42; will only call foo() twice. This is likely not by design,
and was just overlooked in the implementation. The RFC does not specify how
function calls in the lhs of the coalesce assignment behaves. This should
probably be improved in the future.
Now, the problem this commit actually fixes is that ??= may memoize expressions
inside assert() function calls that may not actually execute. This is not only
an issue when using the VAR in the second expression (which would usually also
be skipped) but also when freeing the VAR. For this reason, it is not safe to
memoize assert() sub-expressions.
There are two possible solutions:
1. Don't memoize any sub-expressions of assert(), meaning they will execute
twice.
2. Throw a compile error.
Option 2 is not quite simple, because we can't disallow all memoization inside
assert(), as that would break assertions like assert($array[foo()] ??= 'bar');.
Code like this is highly unlikely (and dubious) but possible. In this case, we
would need to make sure that a memoized value could not be used across the
assert boundary it was created in. The complexity for this is not worthwhile. So
we opt for option 1 and disable memoization immediately inside assert().
Fixes GH-11580
Closes GH-11581
2023-07-03 20:59:13 +08:00
|
|
|
. Fixed use-of-uninitialized-value with ??= on assert. (ilutov)
|
2023-07-07 04:45:29 +08:00
|
|
|
. Fixed bug GH-11601 (Incorrect handling of unwind and graceful exit
|
|
|
|
exceptions). (ilutov)
|
2023-07-08 03:21:11 +08:00
|
|
|
. Added zend_call_stack_get implementation for OpenBSD. (David Carlier)
|
2023-07-08 19:00:23 +08:00
|
|
|
. Fixed oss-fuzz #60411 (Fix double-compilation of arrow-functions). (ilutov)
|
2023-07-09 17:48:01 +08:00
|
|
|
. Fixed build for FreeBSD before the 11.0 releases. (David Carlier)
|
2023-07-16 19:42:35 +08:00
|
|
|
. Add stack limit check in zend_eval_const_expr(). (Arnaud)
|
|
|
|
. Expose time spent collecting cycles in gc_status(). (Arnaud)
|
|
|
|
. Remove WeakMap entries whose key is only reachable through the entry value.
|
|
|
|
(Arnaud)
|
2023-04-01 03:37:45 +08:00
|
|
|
. Resolve open_basedir paths on INI update. (ilutov)
|
2023-06-27 01:08:52 +08:00
|
|
|
|
2023-07-18 02:42:39 +08:00
|
|
|
- Curl:
|
|
|
|
. Added Curl options and constants up to (including) version 7.87.
|
|
|
|
(nielsdos, adoy)
|
|
|
|
|
2023-07-12 04:34:39 +08:00
|
|
|
- DOM:
|
|
|
|
. Added DOMNode::contains() and DOMNameSpaceNode::contains(). (nielsdos)
|
2023-07-13 04:17:10 +08:00
|
|
|
. Added DOMElement::getAttributeNames(). (nielsdos)
|
2023-07-13 04:40:36 +08:00
|
|
|
. Added DOMNode::getRootNode(). (nielsdos)
|
2023-07-14 02:53:52 +08:00
|
|
|
. Added DOMElement::className and DOMElement::id. (nielsdos)
|
2023-07-13 20:55:25 +08:00
|
|
|
. Added DOMParentNode::replaceChildren(). (nielsdos)
|
2023-07-12 00:19:12 +08:00
|
|
|
. Added DOMNode::isConnected and DOMNameSpaceNode::isConnected. (nielsdos)
|
2023-07-12 01:43:37 +08:00
|
|
|
. Added DOMNode::parentElement and DOMNameSpaceNode::parentElement.
|
|
|
|
(nielsdos)
|
2023-07-13 00:07:53 +08:00
|
|
|
. Added DOMNode::isEqualNode(). (nielsdos)
|
2023-07-17 23:42:47 +08:00
|
|
|
. Added DOMElement::insertAdjacentElement() and
|
|
|
|
DOMElement::insertAdjacentText(). (nielsdos)
|
2023-07-13 19:16:40 +08:00
|
|
|
. Added DOMElement::toggleAttribute(). (nielsdos)
|
2023-07-12 04:34:39 +08:00
|
|
|
|
2023-04-13 05:17:03 +08:00
|
|
|
- FPM:
|
|
|
|
. Added warning to log when fpm socket was not registered on the expected
|
|
|
|
path. (Joshua Behrens, Jakub Zelenka)
|
|
|
|
|
2023-07-19 01:24:03 +08:00
|
|
|
- Hash:
|
|
|
|
. Fix use-of-uninitialized-value in hash_pbkdf2(), fix missing $options
|
|
|
|
parameter in signature. (ilutov)
|
Fix most external GD 2.3.3 compatibility
* ext/gd/tests/bug45799.phpt: tweak to work with external gd.
The expected output from this test contains an extra newline with
gd-2.3.3 from the system (Gentoo). Adding a whitespace wildcard takes
care of it, and the test still passes with the bundled version of gd.
* ext/gd/tests: external gd-2.3.3 compatibility.
Support for the legacy "gd" image format was removed from gd-2.3.3
upstream:
https://github.com/libgd/libgd/blob/master/CHANGELOG.md#233---2021-09-12
Several tests for the gd extension utilize that format, and naturally
fail when gd-2.3.3 from the system is used. This commit skips those
tests when the version of gd is at least 2.3.3.
* ext/gd/tests/bug73159.phpt: skip with external gd >= 2.3.3
This test uses the imagegd2() function to check that
https://github.com/libgd/libgd/issues/289
is fixed. When an external gd without support for the "gd" format is
used, no error is thrown, but a nonsense result is printed: this is
normal. The corresponding upstream test is disabled in that situation;
it's not expected to work.
This commit skips the corresponding PHP test under the same
circumstances to fix a test failure with external gd >= 2.3.3.
* ext/gd/tests/bug73155.phpt: skip with external gd >= 2.3.3
This test uses the imagegd2() function to check that
https://github.com/libgd/libgd/issues/309
is fixed. When an external gd without support for the "gd" format is
used, no error is thrown, but a nonsense result is printed: this is
normal. The corresponding upstream test is disabled in that situation;
it's not expected to work.
This commit skips the corresponding PHP test under the same
circumstances to fix a test failure with external gd >= 2.3.3.
* ext/gd/tests/bug73157.phpt: skip with external gd >= 2.3.3
This test ensures that the third (chunk_size) parameter to imagegd2()
is respected when a fourth parameter is also given. However, when an
external gd without support for the "gd" format is used, the call to
imagegd2() does not really work at all. It doesn't fail, but it
produces an "image" with a nonsense chunk size.
To avoid failures when an external gd >= 2.3.3 is used, we skip the
test entirely in that case.
* ext/gd/tests/bug77973.phpt: accept lowercase "Invalid"
This test fails with an external gd because the test expects "Invalid"
where upstream gd says "invalid". This commit tweaks the expected
output to accept an arbitrary character in the i/I position.
* ext/gd/tests/bug39780_extern.phpt: update for external gd-2.3.3.
Since there are no CI runs with external gd, I can only assume that
this test has fallen out-of-date due to changes in PHP itself. I've
tweaked the expected output (only slightly) so that the test passes
with both gd-2.3.2 and gd-2.3.3.
* ext/gd/tests/bug66356.phpt: update expected output for external gd.
Newer (external) versions of GD start their error messages with
lowercase characters, whereas this test is expecting them in
uppercase. A single-character wildcard now supports both formats.
* ext/gd/tests/imagegd_truecolor.phpt: skip with external gd >= 2.3.3.
This test uses the imagegd() function, but the "gd" format has been
disabled by default in upstream gd-2.3.3. We still get some kind of
image data back from the call to imagegd(), but its "signature",
"truecolor", and "size" no longer match the expected values. This
commit skips the test when an external gd >= 2.3.3 is used.
* ext/gd/tests/createfromwbmp2_extern.phpt: update for external gd-2.3.3.
* ext/gd/tests/libgd00086_extern.phpt: update for external gd-2.3.3.
Since there are no CI runs with external gd, I can only assume that
this test has fallen out-of-date due to changes in PHP itself. I've
tweaked the expected output (only slightly) so that the test passes
with both gd-2.3.2 and gd-2.3.3.
* ext/gd/tests/bug77272.phpt: update expected output for external gd.
Newer (external) versions of GD start their error messages with
lowercase characters, whereas this test is expecting them in
uppercase. A single-character wildcard now supports both formats.
* ext/gd/tests/bug77479.phpt: update for newer external gd.
This test fails with gd-2.3.3 (at least) due to minor capitalization
and whitespace issues. We add some wildcards to account for the
difference.
Closes GH-11257.
Closes GH-11262.
Closes GH-11264.
Closes GH-11280.
2023-05-17 20:59:53 +08:00
|
|
|
|
2023-07-10 18:23:49 +08:00
|
|
|
- Intl:
|
|
|
|
. Fix memory leak in MessageFormatter::format() on failure. (Girgias)
|
|
|
|
|
2023-07-11 23:34:38 +08:00
|
|
|
- LDAP:
|
|
|
|
. Deprecate calling ldap_connect() with separate hostname and port.
|
|
|
|
(heiglandreas)
|
|
|
|
|
2023-07-07 18:18:04 +08:00
|
|
|
- OpenSSL:
|
Improve openssl ext to generate EC keys with custom EC parameters
This change extends supported parameter when generating EC keys.
Specifically following parameters are now supported: p, a, b, order,
generator, seed, cofactory, g_x, g_y, x, y and d.
Those parameters can be passed to ec field in openssl_pkey_new options.
It also fixes some issues openssl_pkey_get_details related to SM2
support.
Closes GH-9991
2023-05-13 01:15:24 +08:00
|
|
|
. Added support for additional EC parameters in openssl_pkey_new. (Eno-CN)
|
|
|
|
|
2023-07-07 20:32:43 +08:00
|
|
|
- PDO:
|
2023-07-17 14:09:13 +08:00
|
|
|
. Fix GH-11587 (After php8.1, when PDO::ATTR_EMULATE_PREPARES is true
|
2023-07-07 20:32:43 +08:00
|
|
|
and PDO::ATTR_STRINGIFY_FETCHES is true, decimal zeros are no longer
|
|
|
|
filled). (SakiTakamachi)
|
|
|
|
|
2023-07-07 18:18:04 +08:00
|
|
|
- Random:
|
2023-07-07 18:16:48 +08:00
|
|
|
. Deprecate MT_RAND_PHP. (timwolla)
|
|
|
|
|
2023-07-08 00:05:59 +08:00
|
|
|
- SPL:
|
|
|
|
. Fixed GH-11573 (RecursiveDirectoryIterator::hasChildren is slow).
|
|
|
|
(nielsdos)
|
|
|
|
|
2023-06-20 05:46:52 +08:00
|
|
|
- Standard:
|
|
|
|
. Added support for rounding negative places in number_format().
|
|
|
|
(Marc Bennewitz)
|
2023-07-01 16:52:19 +08:00
|
|
|
. Prevent precision loss on formatting decimal integers in number_format().
|
|
|
|
(Marc Bennewitz)
|
2023-07-16 19:42:35 +08:00
|
|
|
. Added usage of posix_spawn for proc_open when supported by OS.
|
2022-01-12 04:49:07 +08:00
|
|
|
(Cristian Rodriguez)
|
2023-06-20 05:46:52 +08:00
|
|
|
|
2023-07-07 22:33:00 +08:00
|
|
|
- Streams:
|
|
|
|
. Implemented GH-11242 (_php_stream_copy_to_mem: Allow specifying a maximum
|
|
|
|
length without allocating a buffer of that size). (Jakub Zelenka)
|
|
|
|
|
2023-07-05 18:05:05 +08:00
|
|
|
06 Jul 2023, PHP 8.3.0alpha3
|
2023-06-21 00:37:28 +08:00
|
|
|
|
2023-06-23 03:10:00 +08:00
|
|
|
- Core:
|
|
|
|
. Fixed bug GH-11507 (String concatenation performance regression in 8.3).
|
|
|
|
(nielsdos)
|
2023-06-27 01:08:52 +08:00
|
|
|
. Fixed oss-fuzz #60011 (Mis-compilation of by-reference nullsafe operator).
|
|
|
|
(ilutov)
|
2023-06-21 20:27:33 +08:00
|
|
|
. Fixed GH-11488 (Missing "Optional parameter before required" deprecation on
|
|
|
|
union null type). (ilutov)
|
2023-06-30 02:23:53 +08:00
|
|
|
. Implement the #[\Override] attribute RFC. (timwolla)
|
2023-06-23 03:10:00 +08:00
|
|
|
|
2023-06-25 19:48:04 +08:00
|
|
|
- DOM:
|
|
|
|
. Fixed bug GH-11500 (Namespace reuse in createElementNS() generates wrong
|
|
|
|
output). (nielsdos)
|
2023-06-25 20:31:01 +08:00
|
|
|
. Implemented DOMDocument::adoptNode(). Previously this always threw a
|
|
|
|
"not yet implemented" exception. (nielsdos)
|
2023-07-04 03:33:21 +08:00
|
|
|
. Fixed bug GH-9628 (Implicitly removing nodes from \DOMDocument breaks
|
|
|
|
existing references). (nielsdos)
|
2023-06-25 19:48:04 +08:00
|
|
|
|
2023-06-22 23:47:42 +08:00
|
|
|
- Fileinfo:
|
|
|
|
. Fix GH-11408 (Unable to build PHP 8.3.0 alpha 1 / fileinfo extension).
|
|
|
|
(nielsdos)
|
|
|
|
|
2023-06-21 03:22:04 +08:00
|
|
|
- MBString:
|
|
|
|
. Implement mb_str_pad() RFC. (nielsdos)
|
2023-06-23 23:29:49 +08:00
|
|
|
. Fixed bug GH-11514 (PHP 8.3 build fails with --enable-mbstring enabled).
|
|
|
|
(nielsdos)
|
2023-06-21 00:37:28 +08:00
|
|
|
|
2023-06-26 04:27:13 +08:00
|
|
|
- Session:
|
|
|
|
. Fixed bug GH-11529 (Crash after dealing with an Apache request). (nielsdos)
|
|
|
|
|
2023-05-23 23:39:17 +08:00
|
|
|
- Standard:
|
|
|
|
. Fix serialization of RC1 objects appearing in object graph twice. (ilutov)
|
|
|
|
|
2023-06-30 21:18:37 +08:00
|
|
|
- XMLReader:
|
|
|
|
. Fix GH-11548 (Argument corruption when calling XMLReader::open or
|
|
|
|
XMLReader::XML non-statically with observer active). (Bob)
|
|
|
|
|
2023-06-26 22:43:59 +08:00
|
|
|
- zip:
|
|
|
|
. zip extension version 1.22.0 for libzip 1.10.0. (Remi)
|
|
|
|
. add new error macros (ER_DATA_LENGTH and ER_NOT_ALLOWED). (Remi)
|
|
|
|
. add new archive global flags (ER_AFL_*). (Remi)
|
|
|
|
. add ZipArchive::setArchiveFlag and ZipArchive::getArchiveFlag methods.
|
|
|
|
(Remi)
|
|
|
|
|
|
|
|
|
2023-06-21 00:37:28 +08:00
|
|
|
22 Jun 2023, PHP 8.3.0alpha2
|
2023-06-07 02:12:48 +08:00
|
|
|
|
2023-06-08 05:53:21 +08:00
|
|
|
- Core:
|
|
|
|
. Fix GH-11388 (Allow "final" modifier when importing a method from a trait).
|
|
|
|
(nielsdos)
|
2023-06-09 23:06:24 +08:00
|
|
|
. Fixed bug GH-11406 (segfault with unpacking and magic method closure).
|
|
|
|
(nielsdos)
|
2023-06-07 02:12:48 +08:00
|
|
|
|
2023-06-06 03:56:51 +08:00
|
|
|
- DOM:
|
|
|
|
. Fix #79700 (wrong use of libxml oldNs leads to performance problem).
|
|
|
|
(nielsdos)
|
|
|
|
. Fix #77894 (DOMNode::C14N() very slow on generated DOMDocuments even after
|
|
|
|
normalisation). (nielsdos)
|
2023-06-20 01:52:28 +08:00
|
|
|
. Revert changes to DOMAttr::$value and DOMAttr::$nodeValue expansion.
|
|
|
|
(nielsdos)
|
2023-06-06 03:56:51 +08:00
|
|
|
|
2023-06-11 22:46:29 +08:00
|
|
|
- GD:
|
|
|
|
. Removed imagerotate "ignore_transparent" argument since it has no effect.
|
|
|
|
(David Carlier)
|
|
|
|
|
2023-02-04 09:12:49 +08:00
|
|
|
- Streams:
|
|
|
|
. Implement GH-8641 (STREAM_NOTIFY_COMPLETED over HTTP never emitted).
|
|
|
|
(nielsdos, Jakub Zelenka)
|
2023-06-11 01:22:26 +08:00
|
|
|
. Fix bug GH-10406 (fgets on a redis socket connection fails on PHP 8.3).
|
|
|
|
(Jakub Zelenka)
|
2023-02-04 09:12:49 +08:00
|
|
|
|
2023-06-07 02:12:48 +08:00
|
|
|
08 Jun 2023, PHP 8.3.0alpha1
|
2022-08-16 23:39:53 +08:00
|
|
|
|
2022-02-09 02:28:24 +08:00
|
|
|
- CLI:
|
|
|
|
. Added pdeathsig to builtin server to terminate workers when the master
|
|
|
|
process is killed. (ilutov)
|
2023-05-01 05:33:41 +08:00
|
|
|
. Fixed bug GH-11104 (STDIN/STDOUT/STDERR is not available for CLI without
|
|
|
|
a script). (nielsdos)
|
2022-02-09 02:28:24 +08:00
|
|
|
|
2022-08-26 22:33:47 +08:00
|
|
|
- Core:
|
|
|
|
. Fixed bug GH-9388 (Improve unset property and __get type incompatibility
|
|
|
|
error message). (ilutov)
|
2022-09-27 05:02:56 +08:00
|
|
|
. SA_ONSTACK is now set for signal handlers to be friendlier to other
|
|
|
|
in-process code such as Go's cgo. (Kévin Dunglas)
|
2022-10-16 18:21:40 +08:00
|
|
|
. SA_ONSTACK is now set when signals are disabled. (Kévin Dunglas)
|
2022-10-22 17:17:27 +08:00
|
|
|
. Fix GH-9649: Signal handlers now do a no-op instead of crashing when
|
|
|
|
executed on threads not managed by TSRM. (Kévin Dunglas)
|
2022-11-02 21:55:08 +08:00
|
|
|
. Fixed potential NULL pointer dereference Windows shm*() functions. (cmb)
|
2022-07-26 18:52:48 +08:00
|
|
|
. Added shadow stack support for fibers. (Chen Hu)
|
2022-11-11 22:55:03 +08:00
|
|
|
. Fix bug GH-9965 (Fix accidental caching of default arguments with side
|
|
|
|
effects). (ilutov)
|
2023-01-05 21:24:44 +08:00
|
|
|
. Implement GH-10217 (Use strlen() for determining the class_name length).
|
|
|
|
(Dennis Buteyn)
|
2022-08-04 20:12:45 +08:00
|
|
|
. Fix bug GH-8821 (Improve line numbers for errors in constant expressions).
|
|
|
|
(ilutov)
|
2022-12-12 07:23:46 +08:00
|
|
|
. Fix bug GH-10083 (Allow comments between & and parameter). (ilutov)
|
2023-03-10 23:22:42 +08:00
|
|
|
. Zend Max Execution Timers is now enabled by default for ZTS builds on
|
|
|
|
Linux. (Kévin Dunglas)
|
2023-03-23 21:35:50 +08:00
|
|
|
. Fix bug GH-10469 (Disallow .. in open_basedir paths set at runtime).
|
|
|
|
(ilutov)
|
2023-04-05 17:24:06 +08:00
|
|
|
. Fix bug GH-10168, GH-10582 (Various segfaults with destructors and VM return
|
|
|
|
values). (dstogov, nielsdos, ilutov)
|
2023-03-26 01:34:06 +08:00
|
|
|
. Fix bug GH-10935 (Use of trait doesn't redeclare static property if class
|
|
|
|
has inherited it from its parent). (ilutov)
|
2023-04-28 23:12:31 +08:00
|
|
|
. Fix bug GH-11154 (Negative indices on empty array don't affect next chosen
|
|
|
|
index). (ColinHDev)
|
2023-05-11 02:38:33 +08:00
|
|
|
. Fix bug GH-8846 (Implement delayed early binding for classes without
|
|
|
|
parents). (ilutov)
|
2022-12-05 04:59:18 +08:00
|
|
|
. Fix bug #79836 (Segfault in concat_function). (nielsdos)
|
|
|
|
. Fix bug #81705 (type confusion/UAF on set_error_handler with concat
|
|
|
|
operation). (nielsdos)
|
2023-06-04 02:15:23 +08:00
|
|
|
. Fix GH-11348 (Closure created from magic method does not accept named
|
|
|
|
arguments). (nielsdos)
|
2022-08-26 22:33:47 +08:00
|
|
|
|
2023-01-06 23:31:16 +08:00
|
|
|
- Date:
|
|
|
|
. Implement More Appropriate Date/Time Exceptions RFC. (Derick)
|
|
|
|
|
Implement iteration cache, item cache and length cache for node list iteration (#11330)
* Implement iteration cache, item cache and length cache for node list iteration
The current implementation follows the spec requirement that the list
must be "live". This means that changes in the document must be
reflected in the existing node lists without requiring the user to
refetch the node list.
The consequence is that getting any item, or the length of the list,
always starts searching from the root element of the node list. This
results in O(n) time to get any item or the length. If there's a for
loop over the node list, this means the iterations will take O(n²) time
in total. This causes real-world performance issues with potential for
downtime (see GH-11308 and its references for details).
We fix this by introducing a caching strategy. We cache the last
iterated object in the iterator, the last requested item in the node
list, and the last length computation. To invalidate the cache, we
simply count the number of modifications made to the containing
document. If the modification number does not match what the number was
during caching, we know the document has been modified and the cache is
invalid. If this ever overflows, we saturate the modification number and
don't do any caching anymore. Note that we don't check for overflow on
64-bit systems because it would take hundreds of years to overflow.
Fixes GH-11308.
2023-06-03 06:13:14 +08:00
|
|
|
- DOM:
|
2022-12-22 09:34:51 +08:00
|
|
|
. Fix bug GH-8388 (DOMAttr unescapes character reference). (Tim Starling)
|
Implement iteration cache, item cache and length cache for node list iteration (#11330)
* Implement iteration cache, item cache and length cache for node list iteration
The current implementation follows the spec requirement that the list
must be "live". This means that changes in the document must be
reflected in the existing node lists without requiring the user to
refetch the node list.
The consequence is that getting any item, or the length of the list,
always starts searching from the root element of the node list. This
results in O(n) time to get any item or the length. If there's a for
loop over the node list, this means the iterations will take O(n²) time
in total. This causes real-world performance issues with potential for
downtime (see GH-11308 and its references for details).
We fix this by introducing a caching strategy. We cache the last
iterated object in the iterator, the last requested item in the node
list, and the last length computation. To invalidate the cache, we
simply count the number of modifications made to the containing
document. If the modification number does not match what the number was
during caching, we know the document has been modified and the cache is
invalid. If this ever overflows, we saturate the modification number and
don't do any caching anymore. Note that we don't check for overflow on
64-bit systems because it would take hundreds of years to overflow.
Fixes GH-11308.
2023-06-03 06:13:14 +08:00
|
|
|
. Fix bug GH-11308 (getElementsByTagName() is O(N^2)). (nielsdos)
|
|
|
|
|
2023-01-21 22:35:15 +08:00
|
|
|
- Exif:
|
|
|
|
. Removed unneeded codepaths in exif_process_TIFF_in_JPEG(). (nielsdos)
|
|
|
|
|
2022-10-03 04:26:17 +08:00
|
|
|
- Fileinfo:
|
|
|
|
. Upgrade bundled libmagic to 5.43. (Anatol)
|
|
|
|
|
2022-09-09 00:19:34 +08:00
|
|
|
- FPM:
|
|
|
|
. The status.listen shared pool now uses the same php_values (including
|
|
|
|
expose_php) and php_admin_value as the pool it is shared with. (dwxh)
|
|
|
|
|
2022-11-09 06:47:30 +08:00
|
|
|
- GD:
|
|
|
|
. Fixed bug #81739: OOB read due to insufficient input validation in
|
|
|
|
imageloadfont(). (CVE-2022-31630) (cmb)
|
|
|
|
|
|
|
|
- Hash:
|
|
|
|
. Fixed bug #81738: buffer overflow in hash_update() on long parameter.
|
|
|
|
(CVE-2022-37454) (nicky at mouha dot be)
|
|
|
|
|
2022-11-27 18:24:25 +08:00
|
|
|
- Intl:
|
2022-12-10 00:56:43 +08:00
|
|
|
. Added pattern format error infos for numfmt_set_pattern. (David Carlier)
|
2023-02-28 20:08:01 +08:00
|
|
|
. Added MIXED_NUMBERS and HIDDEN_OVERLAY constants for
|
|
|
|
the Spoofchecker's class. (David Carlier)
|
2023-03-06 04:54:34 +08:00
|
|
|
. Updated datefmt_set_timezone/IntlDateformatter::setTimezone returns type.
|
|
|
|
(David Carlier).
|
2023-03-10 07:28:11 +08:00
|
|
|
. Updated IntlBreakInterator::setText return type. (David Carlier)
|
2023-03-22 04:40:53 +08:00
|
|
|
. Updated IntlChar::enumCharNames return type. (David Carlier)
|
2022-11-27 18:24:25 +08:00
|
|
|
|
2022-10-08 21:45:59 +08:00
|
|
|
- JSON:
|
2022-12-10 00:56:28 +08:00
|
|
|
. Added json_validate(). (Juan Morales)
|
2022-10-08 21:45:59 +08:00
|
|
|
|
2022-12-30 04:50:13 +08:00
|
|
|
- MBString:
|
2023-02-17 19:57:42 +08:00
|
|
|
. mb_detect_encoding is better able to identify the correct encoding for
|
|
|
|
Turkish text. (Alex Dowad)
|
Implement mb_detect_encoding using fast text conversion filters
Regarding the optional 3rd `strict` argument to mb_detect_encoding,
the documentation states:
Controls the behaviour when string is not valid in any of the listed encodings.
If strict is set to false, the closest matching encoding will be returned;
if strict is set to true, false will be returned.
(Ref: https://www.php.net/manual/en/function.mb-detect-encoding.php)
Because of bugs in the implementation, mb_detect_encoding did not always
behave according to this description when `strict` was false.
For example:
<?php
echo var_export(mb_detect_encoding("\xc0\x00", "UTF-8", false));
// Before this commit, prints: false
// After this commit, prints: 'UTF-8'
Because `strict` is false in the above example, mb_detect_encoding
should return the 'closest matching encoding', which is UTF-8, since
that is the only candidate encoding. (Incidentally, this example shows
that using mb_detect_encoding with a single candidate encoding in
non-strict mode is useless.)
The new implementation fixes this bug. It also fixes another problem
with the old implementation as regards non-strict detection mode:
The old implementation would stop processing of the input string using
a particular candidate encoding as soon as it saw an error in that
encoding, even in non-strict mode. This means that it could not really
detect the 'closest matching encoding'; rather, what it would return
in non-strict mode was 'the encoding in which the first decoding error
is furthest from the beginning of the input string'.
In non-strict mode, the new implementation continues trying to process
the input string to its end even after seeing an error. This makes it
possible to determine in which candidate encoding the string has the
smallest number of errors, i.e. the 'closest matching encoding'.
Rejecting candidate encodings as soon as it saw an error gave the old
implementation a marked performance advantage in non-strict mode;
however, the new implementation still beats it in most cases. Here are
a few sample microbenchmark results:
UTF-8, ~100 codepoints, strict mode
Old: 0.080s (100,000 calls)
New: 0.026s (" " )
UTF-8, ~100 codepoints, non-strict mode
Old: 0.079s (100,000 calls)
New: 0.033s (" " )
UTF-8, ~10000 codepoints, strict mode
Old: 6.708s (60,000 calls)
New: 1.383s (" " )
UTF-8, ~10000 codepoints, non-strict mode
Old: 6.705s (60,000 calls)
New: 3.044s (" " )
Notice that the old implementation had almost identical performance
between strict and non-strict mode, while the new suffers a significant
performance penalty for non-strict detection. This is the cost of
implementing the behavior specified in the documentation.
A couple more sample results:
SJIS, ~10000 codepoints, strict mode
Old: 4.563s
New: 1.084s
SJIS, ~10000 codepoints, non-strict mode
Old: 4.569s
New: 2.863s
This is the only case I found where the new implementation loses:
UTF-16LE, ~10000 codepoints, non-strict mode
Old: 1.514s
New: 2.813s
The reason is because the test strings happened to be invalid right from
the first few bytes for all the candidate encodings except for UTF-16LE;
so the old implementation would immediately reject all those encodings
and only process the entire string in UTF-16LE.
I believe mb_detect_encoding could be made much faster if we identified
good criteria for when to reject candidate encodings before reaching
the end of the input string.
2022-07-20 14:53:04 +08:00
|
|
|
. mb_detect_encoding's "non-strict" mode now behaves as described in the
|
2023-04-11 01:43:05 +08:00
|
|
|
documentation. Previously, it would return false if the same byte
|
|
|
|
(for example, the first byte) of the input string was invalid in all
|
|
|
|
candidate encodings. More generally, it would eliminate candidate
|
|
|
|
encodings from consideration when an invalid byte was seen, and if the
|
|
|
|
same input byte eliminated all remaining encodings still under
|
|
|
|
consideration, it would return false. On the other hand, if all candidate
|
|
|
|
encodings but one were eliminated from consideration, it would return the
|
|
|
|
last remaining one without regard for how many encoding errors might be
|
|
|
|
encountered later in the string. This is different from the behavior
|
|
|
|
described in the documentation, which says: "If strict is set to false,
|
|
|
|
the closest matching encoding will be returned." (Alex Dowad)
|
Implement Unicode conditional casing rules for Greek letter sigma
The capital Greek letter sigma (Σ) should be lowercased as σ except
when it appears at the end of a word; in that case, it should be
lowercased as the special form ς.
This rule is included in the Unicode data file SpecialCasing.txt.
The condition for applying the rule is called "Final_Sigma" and is
defined in Unicode technical report 21. The rule is:
• For the special casing form to apply, the capital letter sigma must
be preceded by 0 or more "case-ignorable" characters, preceded by
at least 1 "cased" character.
• Further, capital sigma must NOT be followed by 0 or more
case-ignorable characters and then at least 1 cased character.
"Case-ignorable" characters include certain punctuation marks, like
the apostrophe, as well as various accent marks. There are actually
close to 500 different case-ignorable characters, including accent marks
from Cyrillic, Hebrew, Armenian, Arabic, Syriac, Bengali, Gujarati,
Telugu, Tibetan, and many other alphabets. This category also includes
zero-width spaces, codepoints which indicate RTL/LTR text direction,
certain musical symbols, etc.
Since the rule involves scanning over "0 or more" of such
case-ignorable characters, it may be necessary to scan arbitrarily far
to the left and right of capital sigma to determine whether the special
lowercase form should be used or not. However, since we are trying to
be both memory-efficient and CPU-efficient, this implementation limits
how far to the left we will scan. Generally, we scan up to 63 characters
to the left looking for a "cased" character, but not more.
When scanning to the right, we go up to the end of the string if
necessary, even if it means scanning over thousands of characters.
Anyways, it is almost impossible to imagine that natural text will
include "words" with more than 63 successive apostrophes (for example)
followed by a capital sigma.
Closes GH-8096.
2023-01-08 02:27:59 +08:00
|
|
|
. mb_strtolower, mb_strtotitle, and mb_convert_case implement conditional
|
|
|
|
casing rules for the Greek letter sigma. For mb_convert_case, conditional
|
|
|
|
casing only applies to MB_CASE_LOWER and MB_CASE_TITLE modes, not to
|
|
|
|
MB_CASE_LOWER_SIMPLE and MB_CASE_TITLE_SIMPLE. (Alex Dowad)
|
2023-01-13 00:10:04 +08:00
|
|
|
. mb_detect_encoding is better able to identify UTF-8 and UTF-16 strings
|
|
|
|
with a byte-order mark. (Alex Dowad)
|
2023-02-17 19:57:42 +08:00
|
|
|
. mb_decode_mimeheader interprets underscores in QPrint-encoded MIME
|
|
|
|
encoded words as required by RFC 2047; they are converted to spaces.
|
|
|
|
Underscores must be encoded as "=5F" in such MIME encoded words.
|
|
|
|
(Alex Dowad)
|
2023-03-16 10:25:38 +08:00
|
|
|
. mb_encode_mimeheader no longer drops NUL (zero) bytes when
|
|
|
|
QPrint-encoding the input string. This previously caused strings in
|
|
|
|
certain text encodings, especially UTF-16 and UTF-32, to be
|
|
|
|
corrupted by mb_encode_mimeheader. (Alex Dowad)
|
2022-12-30 04:50:13 +08:00
|
|
|
|
2023-03-12 06:29:36 +08:00
|
|
|
- mysqli:
|
|
|
|
. mysqli_fetch_object raises a ValueError instead of an Exception.
|
|
|
|
(David Carlier)
|
|
|
|
|
2022-09-03 00:29:56 +08:00
|
|
|
- Opcache:
|
|
|
|
. Added start, restart and force restart time to opcache's
|
2022-10-08 21:56:29 +08:00
|
|
|
phpinfo section. (Mikhail Galanin)
|
|
|
|
. Fix GH-9139: Allow FFI in opcache.preload when opcache.preload_user=root.
|
|
|
|
(Arnaud, Kapitan Oczywisty)
|
|
|
|
. Made opcache.preload_user always optional in the cli and phpdbg SAPIs.
|
|
|
|
(Arnaud)
|
2022-11-06 00:50:27 +08:00
|
|
|
. Allows W/X bits on page creation on FreeBSD despite system settings.
|
|
|
|
(David Carlier)
|
2023-02-15 00:54:04 +08:00
|
|
|
. Added memfd api usage, on Linux, for zend_shared_alloc_create_lock()
|
|
|
|
to create an abstract anonymous file for the opcache's lock. (Max Kellermann)
|
2022-09-09 17:04:38 +08:00
|
|
|
|
2023-02-25 17:22:09 +08:00
|
|
|
- OpenSSL:
|
|
|
|
. Added OPENSSL_CMS_OLDMIMETYPE and PKCS7_NOOLDMIMETYPE contants to switch
|
|
|
|
between mime content types. (Daniel Kesselberg)
|
2023-04-11 02:12:31 +08:00
|
|
|
. Fixed GH-11054: Reset OpenSSL errors when using a PEM public key.
|
|
|
|
(Florian Moser)
|
2023-02-25 17:22:09 +08:00
|
|
|
|
2022-10-16 18:21:40 +08:00
|
|
|
- PCNTL:
|
|
|
|
. SA_ONSTACK is now set for pcntl_signal. (Kévin Dunglas)
|
2022-11-12 03:15:58 +08:00
|
|
|
. Added SIGINFO constant. (David Carlier)
|
2022-10-16 18:21:40 +08:00
|
|
|
|
2023-03-12 06:29:36 +08:00
|
|
|
- PGSQL:
|
|
|
|
. pg_fetch_object raises a ValueError instead of an Exception.
|
|
|
|
(David Carlier)
|
2023-03-17 17:45:36 +08:00
|
|
|
. Added GH-9344, pipeline mode support. (David Carlier)
|
2023-04-15 21:53:42 +08:00
|
|
|
. pg_cancel use thread safe PQcancel api instead. (David Carlier)
|
2023-04-09 18:59:50 +08:00
|
|
|
. pg_trace new PGSQL_TRACE_SUPPRESS_TIMESTAMPS/PGSQL_TRACE_REGRESS_MODE
|
|
|
|
contants support. (David Carlier)
|
2023-05-03 02:05:53 +08:00
|
|
|
. pg_set_error_verbosity adding PGSQL_ERRORS_STATE constant. (David Carlier)
|
2023-05-13 23:30:25 +08:00
|
|
|
. pg_convert/pg_insert E_WARNING on type errors had been converted to
|
|
|
|
ValueError/TypeError exceptions. (David Carlier)
|
2023-06-08 04:33:47 +08:00
|
|
|
. Added pg_set_error_context_visibility to set the context's visibility
|
|
|
|
within the error messages. (David Carlier)
|
2023-03-12 06:29:36 +08:00
|
|
|
|
2023-03-14 15:48:03 +08:00
|
|
|
- Phar:
|
|
|
|
. Fix memory leak in phar_rename_archive(). (stkeke)
|
|
|
|
|
2022-09-05 02:52:21 +08:00
|
|
|
- Posix:
|
|
|
|
. Added posix_sysconf. (David Carlier)
|
2023-01-06 06:30:04 +08:00
|
|
|
. Added posix_pathconf. (David Carlier)
|
2023-01-07 16:34:56 +08:00
|
|
|
. Added posix_fpathconf. (David Carlier)
|
2023-02-14 03:43:29 +08:00
|
|
|
. Fixed zend_parse_arg_long's bool pointer argument assignment. (Cristian Rodriguez)
|
2023-03-24 03:46:17 +08:00
|
|
|
. Added posix_eaccess. (David Carlier)
|
2022-09-05 02:52:21 +08:00
|
|
|
|
2022-12-10 00:39:13 +08:00
|
|
|
- Random:
|
|
|
|
. Added Randomizer::getBytesFromString(). (Joshua Rüsweg)
|
2022-12-15 00:48:47 +08:00
|
|
|
. Added Randomizer::nextFloat(), ::getFloat(), and IntervalBoundary. (timwolla)
|
2023-01-21 06:35:08 +08:00
|
|
|
. Fix GH-10292 (Made the default value of the first param of srand() and
|
|
|
|
mt_srand() nullable). (kocsismate)
|
2023-01-15 20:48:39 +08:00
|
|
|
. Enable getrandom() for NetBSD (from 10.x). (David Carlier)
|
2022-12-10 00:39:13 +08:00
|
|
|
|
2022-11-09 06:47:30 +08:00
|
|
|
- Reflection:
|
|
|
|
. Fix GH-9470 (ReflectionMethod constructor should not find private parent
|
|
|
|
method). (ilutov)
|
2023-01-25 05:26:52 +08:00
|
|
|
. Fix GH-10259 (ReflectionClass::getStaticProperties doesn't need null return
|
|
|
|
type). (kocsismate)
|
2023-02-24 06:28:31 +08:00
|
|
|
. Fix Segfault when using ReflectionFiber suspended by an internal function.
|
|
|
|
(danog)
|
2022-11-09 06:47:30 +08:00
|
|
|
|
2023-04-30 03:28:03 +08:00
|
|
|
- SAPI:
|
|
|
|
. Fixed GH-11141 (Could not open input file: should be sent to stderr).
|
|
|
|
(nielsdos)
|
|
|
|
|
2022-02-09 02:28:24 +08:00
|
|
|
- Sockets:
|
|
|
|
. Added SO_ATTACH_REUSEPORT_CBPF socket option, to give tighter control
|
2022-10-08 21:56:29 +08:00
|
|
|
over socket binding for a cpu core. (David Carlier)
|
2022-10-08 09:48:24 +08:00
|
|
|
. Added SKF_AD_QUEUE for cbpf filters. (David Carlier)
|
2022-10-29 03:08:46 +08:00
|
|
|
. Added socket_atmark if send/recv needs using MSG_OOB. (David Carlier)
|
2022-12-22 00:31:18 +08:00
|
|
|
. Added TCP_QUICKACK constant, to give tigher control over
|
|
|
|
ACK delays. (David Carlier)
|
2023-01-11 04:39:19 +08:00
|
|
|
. Added DONTFRAGMENT support for path MTU discovery purpose. (David Carlier)
|
2023-01-23 01:08:28 +08:00
|
|
|
. Added AF_DIVERT for raw socket for divert ports. (David Carlier)
|
2023-01-29 03:44:37 +08:00
|
|
|
. Added SOL_UPDLITE, UDPLITE_RECV_CSCOV and UDPLITE_SEND_CSCOV for updlite
|
|
|
|
protocol support. (David Carlier)
|
2023-02-11 15:50:36 +08:00
|
|
|
. Added SO_RERROR, SO_ZEROIZE and SO_SPLICE netbsd and openbsd constants.
|
2023-02-28 20:08:01 +08:00
|
|
|
(David Carlier)
|
|
|
|
. Added TCP_REPAIR for quietly close a connection. (David Carlier)
|
2023-04-08 15:50:40 +08:00
|
|
|
. Added SO_REUSEPORT_LB freebsd constant. (David Carlier)
|
2023-04-23 00:44:42 +08:00
|
|
|
. Added IP_BIND_ADDRESS_NO_PORT. (David Carlier)
|
2021-10-05 22:27:03 +08:00
|
|
|
|
2022-11-16 02:36:38 +08:00
|
|
|
- Standard:
|
2022-12-15 00:43:43 +08:00
|
|
|
. E_NOTICEs emitted by unserialize() have been promoted to E_WARNING. (timwolla)
|
2023-05-02 01:06:40 +08:00
|
|
|
. unserialize() now emits a new E_WARNING if the input contains unconsumed
|
|
|
|
bytes. (timwolla)
|
2023-01-14 19:19:35 +08:00
|
|
|
. Make array_pad's $length warning less confusing. (nielsdos)
|
2022-11-29 04:40:32 +08:00
|
|
|
. E_WARNING emitted by strtok in the caase both arguments are not provided when
|
|
|
|
starting tokenisation. (David Carlier)
|
2023-01-24 01:35:16 +08:00
|
|
|
. password_hash() will now chain the original RandomException to the ValueError
|
|
|
|
on salt generation failure. (timwolla)
|
2023-01-07 04:47:22 +08:00
|
|
|
. Fix GH-10239 (proc_close after proc_get_status always returns -1). (nielsdos)
|
2023-03-27 06:04:42 +08:00
|
|
|
. Improve the warning message for unpack() in case not enough values were
|
|
|
|
provided. (nielsdos)
|
2023-04-04 22:14:24 +08:00
|
|
|
. Fix GH-11010 (parse_ini_string() now preserves formatting of unquoted
|
|
|
|
strings starting with numbers when the INI_SCANNER_TYPED flag is
|
|
|
|
specified). (ilutov)
|
2023-03-02 01:30:15 +08:00
|
|
|
. Fix GH-10742 (http_response_code emits no error when headers were already
|
|
|
|
sent). (NattyNarwhal)
|
2022-11-16 02:36:38 +08:00
|
|
|
|
2022-10-05 21:31:28 +08:00
|
|
|
- Streams:
|
|
|
|
. Fixed bug #51056: blocking fread() will block even if data is available.
|
|
|
|
(Jakub Zelenka)
|
2023-04-20 16:34:25 +08:00
|
|
|
. Added storing of the original path used to open xport stream.
|
|
|
|
(Luc Vieillescazes)
|
2022-10-05 21:31:28 +08:00
|
|
|
|
2023-01-14 23:21:35 +08:00
|
|
|
- XSLTProcessor:
|
|
|
|
. Fixed bug #69168 (DomNode::getNodePath() returns invalid path). (nielsdos)
|
|
|
|
|
2013-05-17 17:22:04 +08:00
|
|
|
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
|