Skip to content

Commit 15ac689

Browse files
committed
Merge branch 'master' into debuginfo-return-null-deprecate
2 parents fb64cbf + b89e0ef commit 15ac689

175 files changed

Lines changed: 2662 additions & 658 deletions

File tree

Some content is hidden

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

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ repository. Mailing list subscription is explained on the
9191
[mailing lists page](https://www.php.net/mailing-lists.php).
9292

9393
You may also want to read
94-
[The Mysterious PHP RFC Process](https://blogs.oracle.com/opal/post/the-mysterious-php-rfc-process-and-how-you-can-change-the-web)
94+
[The Mysterious PHP RFC Process](https://web.archive.org/web/20210621140006/https://blogs.oracle.com/opal/the-mysterious-php-rfc-process-and-how-you-can-change-the-web)
9595
for additional notes on the best way to approach submitting an RFC.
9696

9797
## Technical resources

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ PHP NEWS
5151
. gmp_fact() reject values larger than unsigned long. (David Carlier)
5252
. gmp_pow/binomial/root/rootrem and shift/pow operators reject values
5353
larger than unsigned long. (David Carlier)
54+
. GMP exponentiation and shift operators now emit a deprecation warning
55+
when converting a float right operand to int loses precision. (Weilin Du)
5456

5557
- Hash:
5658
. Upgrade xxHash to 0.8.2. (timwolla)
@@ -62,6 +64,10 @@ PHP NEWS
6264
. Fixed bug GH-20426 (Spoofchecker::setRestrictionLevel() error message
6365
suggests missing constants). (DanielEScherzer)
6466
. Added grapheme_strrev (Yuya Hamada)
67+
. Passing a non-stringable object as a time zone to Intl time zone
68+
argument handling now raises TypeError instead of Error. (Weilin Du)
69+
. IntlBreakIterator::getLocale() now raises ValueError for invalid locale
70+
types. (Weilin Du)
6571

6672
- JSON:
6773
. Enriched JSON last error / exception message with error location.

UPGRADING

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ PHP 8.6 UPGRADE NOTES
3434
array arguments types/values and raise a TypeError/ValueError
3535
accordingly.
3636

37+
- Intl:
38+
. Passing a non-stringable object as a time zone to Intl APIs that accept
39+
time zone objects or strings now raises a TypeError instead of an Error.
40+
. IntlBreakIterator::getLocale() now raises a ValueError when the type is
41+
neither Locale::ACTUAL_LOCALE nor Locale::VALID_LOCALE instead of
42+
returning false.
43+
3744
- PCNTL:
3845
. pcntl_alarm() now raises a ValueError if the seconds argument is
3946
lower than zero or greater than platform's UINT_MAX.
@@ -129,6 +136,8 @@ PHP 8.6 UPGRADE NOTES
129136
- Core:
130137
. It is now possible to use reference assign on WeakMap without the key
131138
needing to be present beforehand.
139+
. It is now possible to define the `__debugInfo()` magic method on enums.
140+
RFC: https://wiki.php.net/rfc/debugable-enums
132141

133142
- Fileinfo:
134143
. finfo_file() now works with remote streams.
@@ -180,6 +189,11 @@ PHP 8.6 UPGRADE NOTES
180189
4. Deprecated Functionality
181190
========================================
182191

192+
- GMP
193+
. The shift (<<, >>) and exponentiation (**) operators on GMP objects now
194+
emit a deprecation warning when converting a float right operand to int
195+
loses precision.
196+
183197
- Mbstring:
184198
. Mbregex has been deprecated, because the underlying Oniguruma library
185199
is no longer maintained.

UPGRADING.INTERNALS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ PHP 8.6 INTERNALS UPGRADE NOTES
103103
. The deprecated Z_IMMUTABLE(), Z_IMMUTABLE_P(), Z_OPT_IMMUTABLE(), and
104104
Z_OPT_IMMUTABLE_P() macros have been removed. Check for
105105
IS_ARRAY && !REFCOUNTED directly.
106+
. Added zend_fcall_info.consumed_args together with
107+
zend_fci_consumed_arg(), which allows moving a selected callback argument
108+
instead of copying it in zend_call_function(). Currently only a single
109+
consumed argument is supported.
106110

107111
========================
108112
2. Build system changes

Zend/asm/save_xmm_x86_64_ms_masm.asm

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,34 @@ EXTERN execute_ex_real:PROC
99
; save the preserved registers when re-entering the VM from JIT code.
1010
; See GH-18136.
1111
execute_ex PROC EXPORT FRAME
12-
; 10 floating points numbers
12+
; 10 XMM registers
1313
; 32 bytes shadow space
1414
; 8 bytes to align after the return address
15-
sub rsp, 8*10 + 32 + 8
16-
.allocstack 8*10 + 32 + 8
15+
sub rsp, 16*10 + 32 + 8
16+
.allocstack 16*10 + 32 + 8
1717
.endprolog
18-
movsd qword ptr [rsp + 32 + 8*0], xmm6
19-
movsd qword ptr [rsp + 32 + 8*1], xmm7
20-
movsd qword ptr [rsp + 32 + 8*2], xmm8
21-
movsd qword ptr [rsp + 32 + 8*3], xmm9
22-
movsd qword ptr [rsp + 32 + 8*4], xmm10
23-
movsd qword ptr [rsp + 32 + 8*5], xmm11
24-
movsd qword ptr [rsp + 32 + 8*6], xmm12
25-
movsd qword ptr [rsp + 32 + 8*7], xmm13
26-
movsd qword ptr [rsp + 32 + 8*8], xmm14
27-
movsd qword ptr [rsp + 32 + 8*9], xmm15
18+
movaps xmmword ptr [rsp + 32 + 16*0], xmm6
19+
movaps xmmword ptr [rsp + 32 + 16*1], xmm7
20+
movaps xmmword ptr [rsp + 32 + 16*2], xmm8
21+
movaps xmmword ptr [rsp + 32 + 16*3], xmm9
22+
movaps xmmword ptr [rsp + 32 + 16*4], xmm10
23+
movaps xmmword ptr [rsp + 32 + 16*5], xmm11
24+
movaps xmmword ptr [rsp + 32 + 16*6], xmm12
25+
movaps xmmword ptr [rsp + 32 + 16*7], xmm13
26+
movaps xmmword ptr [rsp + 32 + 16*8], xmm14
27+
movaps xmmword ptr [rsp + 32 + 16*9], xmm15
2828
call execute_ex_real
29-
movsd xmm6, qword ptr [rsp + 32 + 8*0]
30-
movsd xmm7, qword ptr [rsp + 32 + 8*1]
31-
movsd xmm8, qword ptr [rsp + 32 + 8*2]
32-
movsd xmm9, qword ptr [rsp + 32 + 8*3]
33-
movsd xmm10, qword ptr [rsp + 32 + 8*4]
34-
movsd xmm11, qword ptr [rsp + 32 + 8*5]
35-
movsd xmm12, qword ptr [rsp + 32 + 8*6]
36-
movsd xmm13, qword ptr [rsp + 32 + 8*7]
37-
movsd xmm14, qword ptr [rsp + 32 + 8*8]
38-
movsd xmm15, qword ptr [rsp + 32 + 8*9]
39-
add rsp, 8*10 + 32 + 8
29+
movaps xmm6, xmmword ptr [rsp + 32 + 16*0]
30+
movaps xmm7, xmmword ptr [rsp + 32 + 16*1]
31+
movaps xmm8, xmmword ptr [rsp + 32 + 16*2]
32+
movaps xmm9, xmmword ptr [rsp + 32 + 16*3]
33+
movaps xmm10, xmmword ptr [rsp + 32 + 16*4]
34+
movaps xmm11, xmmword ptr [rsp + 32 + 16*5]
35+
movaps xmm12, xmmword ptr [rsp + 32 + 16*6]
36+
movaps xmm13, xmmword ptr [rsp + 32 + 16*7]
37+
movaps xmm14, xmmword ptr [rsp + 32 + 16*8]
38+
movaps xmm15, xmmword ptr [rsp + 32 + 16*9]
39+
add rsp, 16*10 + 32 + 8
4040
ret
4141
execute_ex ENDP
4242

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
GHSA-wm6j-2649-pv75: Null pointer dereference in php_mb_check_encoding() via mb_ereg_search_init()
3+
--CREDITS--
4+
vi3tL0u1s
5+
--EXTENSIONS--
6+
mbstring
7+
--SKIPIF--
8+
<?php
9+
if (!function_exists('mb_regex_encoding')) die('skip No mbregex support');
10+
?>
11+
--FILE--
12+
<?php
13+
// iso-8859-11 is supported by Oniguruma but not by mbfl
14+
mb_regex_encoding('iso-8859-11');
15+
mb_ereg_search_init('x');
16+
?>
17+
--EXPECTF--
18+
Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
19+
20+
Fatal error: Uncaught ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "iso-8859-11" given in %s:%d
21+
Stack trace:
22+
#0 %s(%d): mb_regex_encoding('iso-8859-11')
23+
#1 {main}
24+
thrown in %s on line %d

Zend/tests/enum/__debugInfo.phpt

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
Enum with __debugInfo() magic method - backed enum value accessible
3+
--FILE--
4+
<?php
5+
6+
enum Foo: string {
7+
case Bar = "Baz";
8+
9+
public function __debugInfo() {
10+
return [__CLASS__ . '::' . $this->name . ' = ' . $this->value];
11+
}
12+
}
13+
14+
var_dump(Foo::Bar);
15+
16+
?>
17+
--EXPECT--
18+
enum(Foo::Bar) (1) {
19+
[0]=>
20+
string(14) "Foo::Bar = Baz"
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
Enum supports __debugInfo() magic method
3+
--FILE--
4+
<?php
5+
6+
enum Foo {
7+
case Bar;
8+
9+
public function __debugInfo() {
10+
return [$this->name . ' is a case of the ' . __CLASS__ . ' enum'];
11+
}
12+
}
13+
14+
var_dump(Foo::Bar);
15+
16+
?>
17+
--EXPECT--
18+
enum(Foo::Bar) (1) {
19+
[0]=>
20+
string(29) "Bar is a case of the Foo enum"
21+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
When an enum does not have __debugInfo() it is printed nicely
3+
--FILE--
4+
<?php
5+
6+
enum Foo {
7+
case Bar;
8+
}
9+
10+
var_dump(Foo::Bar);
11+
12+
?>
13+
--EXPECT--
14+
enum(Foo::Bar)

0 commit comments

Comments
 (0)