Skip to content

Commit 0012f8d

Browse files
committed
Merge branch 'master' into uri-naming
2 parents 8e29b80 + 5127a22 commit 0012f8d

File tree

140 files changed

+60869
-4016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+60869
-4016
lines changed

NEWS

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ PHP NEWS
1515
. Added support for configuring the URI parser for the FTP/FTPS as well as
1616
the SSL/TLS stream wrappers as described in
1717
https://wiki.php.net/rfc/url_parsing_api#plugability. (kocsismate)
18+
. Fixed bug GH-19548 (Shared memory violation on property inheritance).
19+
(alexandre-daubois)
20+
. Fixed bug GH-19544 (GC treats ZEND_WEAKREF_TAG_MAP references as WeakMap
21+
references). (Arnaud, timwolla)
22+
. Introduced the TAILCALL VM, enabled by default when compiling with Clang>=19
23+
on x86_64 or aarch64. (Arnaud)
24+
. Enacted the follow-up phase of the "Path to Saner Increment/Decrement
25+
operators" RFC, meaning that incrementing non-numeric strings is now
26+
deprecated. (Girgias).
27+
. Various closure binding issues are now deprecated. (alexandre-daubois)
1828

1929
- Filter:
2030
. Added support for configuring the URI parser for FILTER_VALIDATE_URL
@@ -31,6 +41,9 @@ PHP NEWS
3141
. Implement #81724 (openssl_cms_encrypt only allows specific ciphers).
3242
(Jakub Zelenka)
3343

44+
- Phar:
45+
. Fixed memory leaks when verifying OpenSSL signature. (Girgias)
46+
3447
- Session:
3548
. Added support for partitioned cookies. (nielsdos)
3649

@@ -48,6 +61,10 @@ PHP NEWS
4861
(Girgias)
4962
. Added support for partitioned cookies. (nielsdos)
5063

64+
- Tokenizer:
65+
. Fixed bug GH-19507 (Corrupted result after recursive tokenization during
66+
token_get_all()). (kubawerlos, nielsdos, Arnaud)
67+
5168
14 Aug 2025, PHP 8.5.0beta1
5269

5370
- Core:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-de
5555
On MacOS, you can install these using `brew`:
5656

5757
```shell
58-
brew install autoconf bison re2c iconv libxml2 sqlite
58+
brew install autoconf bison re2c libiconv libxml2 sqlite
5959
```
6060

6161
or with `MacPorts`:

UPGRADING

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,20 @@ PHP 8.5 UPGRADE NOTES
356356
. Constant redeclaration is deprecated and that behavior will trigger an
357357
error in PHP 9.
358358
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_constant_redeclaration
359+
. Enacted the follow-up phase of the "Path to Saner Increment/Decrement
360+
operators" RFC, meaning that incrementing non-numeric strings is now
361+
deprecated. Instead the str_increment() function should be used.
362+
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#enact_follow-up_phase_of_the_path_to_saner_incrementdecrement_operators_rfc
363+
. The following closure binding issues, which already emit an E_WARNING, are
364+
now deprecated:
365+
- Binding an instance to a static closure
366+
- Binding methods to objects that are not instances of the class
367+
(or subclass) that the method is defined
368+
- Unbinding $this from a method
369+
- Unbinding $this from a closure that uses `$this`
370+
- Binding a closure to the scope of an internal class
371+
- Rebinding the scope of a closure created from a function or method
372+
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_closure_binding_issues
359373

360374
- Curl:
361375
. The curl_close() function has been deprecated, as CurlHandle objects are
@@ -883,6 +897,11 @@ PHP 8.5 UPGRADE NOTES
883897
. Creating exception objects is now much faster.
884898
. The parts of the code that used SSE2 have been adapted to use SIMD
885899
with ARM NEON as well.
900+
. Introduced the TAILCALL VM, enabled by default when compiling with Clang>=19
901+
on x86_64 or aarch64. The TAILCALL VM is as fast as the HYBRID VM used when
902+
compiling with GCC. This makes PHP binaries built with Clang>=19 as fast as
903+
binaries built with GCC. The performance of the CALL VM, used with other
904+
compilers, has also improved considerably.
886905

887906
- Intl:
888907
. Now avoids creating extra string copies when converting strings

Zend/Zend.m4

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ ZEND_CHECK_STACK_DIRECTION
170170
ZEND_CHECK_FLOAT_PRECISION
171171
ZEND_DLSYM_CHECK
172172
ZEND_CHECK_GLOBAL_REGISTER_VARIABLES
173+
ZEND_CHECK_PRESERVE_NONE
173174
ZEND_CHECK_CPUID_COUNT
174175
175176
AC_MSG_CHECKING([whether to enable thread safety])
@@ -464,3 +465,103 @@ AS_VAR_IF([ZEND_MAX_EXECUTION_TIMERS], [yes],
464465
AC_MSG_CHECKING([whether to enable Zend max execution timers])
465466
AC_MSG_RESULT([$ZEND_MAX_EXECUTION_TIMERS])
466467
])
468+
469+
dnl
470+
dnl ZEND_CHECK_PRESERVE_NONE
471+
dnl
472+
dnl Check if the preserve_none calling convention is supported and matches our
473+
dnl expectations.
474+
dnl
475+
AC_DEFUN([ZEND_CHECK_PRESERVE_NONE], [dnl
476+
AC_CACHE_CHECK([for preserve_none calling convention],
477+
[php_cv_preverve_none],
478+
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
479+
#include <stdio.h>
480+
#include <stdint.h>
481+
482+
const char * const1 = "str1";
483+
const char * const2 = "str2";
484+
const char * const3 = "str3";
485+
uint64_t key = UINT64_C(0x9d7f71d2bd296364);
486+
487+
uintptr_t _a = 0;
488+
uintptr_t _b = 0;
489+
490+
uintptr_t __attribute__((preserve_none)) fun(uintptr_t a, uintptr_t b) {
491+
_a = a;
492+
_b = b;
493+
return (uintptr_t)const3;
494+
}
495+
496+
uintptr_t __attribute__((preserve_none)) test(void) {
497+
uintptr_t ret;
498+
499+
#if defined(__x86_64__)
500+
__asm__ __volatile__(
501+
/* XORing to make it unlikely the value exists in any other register */
502+
"movq %1, %%r12\n"
503+
"xorq %3, %%r12\n"
504+
"movq %2, %%r13\n"
505+
"xorq %3, %%r13\n"
506+
"xorq %%rax, %%rax\n"
507+
"call fun\n"
508+
: "=a" (ret)
509+
: "r" (const1), "r" (const2), "r" (key)
510+
: "r12", "r13"
511+
);
512+
#elif defined(__aarch64__)
513+
__asm__ __volatile__(
514+
/* XORing to make it unlikely the value exists in any other register */
515+
"eor x20, %1, %3\n"
516+
"eor x21, %2, %3\n"
517+
"eor x0, x0, x0\n"
518+
"bl fun\n"
519+
"mov %0, x0\n"
520+
: "=r" (ret)
521+
: "r" (const1), "r" (const2), "r" (key)
522+
: "x0", "x21", "x22", "x30"
523+
);
524+
#else
525+
# error
526+
#endif
527+
528+
return ret;
529+
}
530+
531+
int main(void) {
532+
533+
/* JIT is making the following expectations about preserve_none:
534+
* - The registers used for integer args 1 and 2
535+
* - The register used for a single integer return value
536+
*
537+
* We check these expectations here:
538+
*/
539+
540+
uintptr_t ret = test();
541+
542+
if (_a != ((uintptr_t)const1 ^ key)) {
543+
fprintf(stderr, "arg1 mismatch\n");
544+
return 1;
545+
}
546+
if (_b != ((uintptr_t)const2 ^ key)) {
547+
fprintf(stderr, "arg2 mismatch\n");
548+
return 2;
549+
}
550+
if (ret != (uintptr_t)const3) {
551+
fprintf(stderr, "ret mismatch\n");
552+
return 3;
553+
}
554+
555+
fprintf(stderr, "OK\n");
556+
557+
return 0;
558+
}]])],
559+
[php_cv_preserve_none=yes],
560+
[php_cv_preserve_none=no],
561+
[php_cv_preserve_none=no])
562+
])
563+
AS_VAR_IF([php_cv_preserve_none], [yes], [
564+
AC_DEFINE([HAVE_PRESERVE_NONE], [1],
565+
[Define to 1 if you have preserve_none support.])
566+
])
567+
])

Zend/tests/bug70681.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ var_dump($c("foo"));
1212

1313
?>
1414
--EXPECTF--
15-
Warning: Cannot unbind $this of method in %s on line %d
15+
Warning: Cannot unbind $this of method, this will be an error in PHP 9 in %s on line %d
1616
int(3)

Zend/tests/bug71300.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,22 @@ function test2() {
2222
var_dump(test2());
2323
?>
2424
--EXPECTF--
25+
Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d
26+
27+
Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d
28+
29+
Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d
30+
31+
Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d
32+
33+
Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d
34+
35+
Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d
36+
37+
Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d
2538
string(4) "test"
2639

40+
Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d
41+
2742
Warning: Array to string conversion in %s on line %d
2843
string(9) "Arraytest"

Zend/tests/closures/bug70630.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ $x = (new ReflectionFunction("substr"))->getClosure();
77
$x->call(new a);
88
?>
99
--EXPECTF--
10-
Warning: Cannot rebind scope of closure created from function in %s on line %d
10+
Warning: Cannot rebind scope of closure created from function, this will be an error in PHP 9 in %s on line %d

Zend/tests/closures/bug70685.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ var_dump($c);
1515

1616
?>
1717
--EXPECTF--
18-
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls in %s on line %d
18+
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls, this will be an error in PHP 9 in %s on line %d
1919
NULL
2020

21-
Warning: Cannot rebind scope of closure created from method in %s on line %d
21+
Warning: Cannot rebind scope of closure created from method, this will be an error in PHP 9 in %s on line %d
2222
NULL

Zend/tests/closures/closure_040.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ $cas->bindTo($a, 'A');
3636
--EXPECTF--
3737
Closure::bindTo(): Argument #2 ($newScope) must be of type object|string|null, array given
3838

39-
Warning: Cannot bind an instance to a static closure in %s on line %d
39+
Warning: Cannot bind an instance to a static closure, this will be an error in PHP 9 in %s on line %d

Zend/tests/closures/closure_041.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ bound: no
8080
scoped to A: bool(true)
8181
bound: no
8282

83-
Warning: Cannot unbind $this of closure using $this in %s on line %d
83+
Warning: Cannot unbind $this of closure using $this, this will be an error in PHP 9 in %s on line %d
8484
NULL
8585

8686
After binding, with same-class instance for the bound ones
8787

88-
Warning: Cannot bind an instance to a static closure in %s on line %d
88+
Warning: Cannot bind an instance to a static closure, this will be an error in PHP 9 in %s on line %d
8989
scoped to A: bool(false)
9090
bound: A (should be scoped to dummy class)
9191

92-
Warning: Cannot bind an instance to a static closure in %s on line %d
92+
Warning: Cannot bind an instance to a static closure, this will be an error in PHP 9 in %s on line %d
9393
scoped to A: bool(true)
9494
bound: A
9595
After binding, with different instance for the bound ones

0 commit comments

Comments
 (0)