Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9f23a4d
Bound getSingletonPos before reading the next separator (#23350)
iliaal Aug 18, 2026
b74bc27
Merge branch 'PHP-8.4' into PHP-8.5
LamentXU123 Aug 18, 2026
05922b7
Merge branch 'PHP-8.5'
LamentXU123 Aug 18, 2026
9002df8
Stop grapheme_str_split from using UBRK_DONE as a byte index (#23349)
iliaal Aug 18, 2026
17ee5f6
Merge branch 'PHP-8.4' into PHP-8.5
LamentXU123 Aug 18, 2026
54371b5
Merge branch 'PHP-8.5'
LamentXU123 Aug 18, 2026
0f4c6ff
ext/snmp: Put XFAILs under SKIPIF section in tests (#23237)
LamentXU123 Aug 18, 2026
e382e51
Merge branch 'PHP-8.4' into PHP-8.5
LamentXU123 Aug 18, 2026
5035624
Merge branch 'PHP-8.5'
LamentXU123 Aug 18, 2026
170ca63
ext/date: applied fixers to improve test robustness
NickSdot Aug 4, 2026
d19f248
Fix GH-23331: UAF when an attribute child keeps a live wrapper
iliaal Aug 17, 2026
e353b8b
Merge branch 'PHP-8.4' into PHP-8.5
iliaal Aug 18, 2026
030de77
Merge branch 'PHP-8.5'
iliaal Aug 18, 2026
0dd7f31
Fix UAF when setAttributeNS() frees a wrapped attribute child
iliaal Aug 17, 2026
45013aa
Merge branch 'PHP-8.4' into PHP-8.5
iliaal Aug 18, 2026
5210969
Merge branch 'PHP-8.5'
iliaal Aug 18, 2026
52767e6
session: fix create_sid()/validateId() check depending on interface o…
lazerg Aug 18, 2026
e721b3f
Deprecate returning from a finally block. (#22509)
aldemeery Aug 18, 2026
f7e9b5a
NEWS/UPGRADING for return in finally deprecation
Girgias Aug 18, 2026
90b43f0
Fix GH-23056: missing handler name in session write warning (#23059)
lazerg Aug 18, 2026
9f1437e
Update NEWS for session bugfix
Girgias Aug 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ PHP NEWS
. Fixed GH-10497 (Allow direct mutation of objects stored in constants or
class constants via OBJ->prop = $val). (Khaled Alam)
. Reverted GH-22833, which attempted to fix bug GH-18985. (ilutov)
. Using the return statement in a finally block is now deprecated.
(aldemeery)

- Curl:
. Set content length using CURLOPT_POSTFIELDSIZE_LARGE instead of
Expand All @@ -21,6 +23,10 @@ PHP NEWS
DOMDocument::xinclude(). (iliaal)
. Fixed a crash in DOMXPath when a php:function callback receives a nodeset
and a later callback returns a node from another document. (iliaal)
. Fixed bug GH-23331 (UAF when node_list_unlink() skips attribute children
that still have a live wrapper). (iliaal)
. Fixed a use-after-free when Dom\Element::setAttributeNS() replaces the
value of an attribute whose child still has a live wrapper. (iliaal)

- PDO_PGSQL:
. Fixed several lazy fetch (PDO::ATTR_PREFETCH => 0) defects: an infinite
Expand All @@ -36,6 +42,9 @@ PHP NEWS
the ICU constructor adopts the TimeZone. (iliaal)
. Fixed bug GH-23094 (NumberFormatter parsing offsets use UTF-16 positions
for UTF-8 strings). (ColumbusLabs)
. Fixed Locale::parseLocale() reading past a trailing '-' or '_'.
(iliaal, Xuyang Zhang)
. Fixed grapheme_str_split() treating UBRK_DONE as a byte index. (iliaal)

- Phar:
. Fixed Phar archives being automatically detected when ".phar" only occurs
Expand All @@ -45,6 +54,10 @@ PHP NEWS
- Readline:
. Fixed class constant completion in the interactive shell. (Weilin Du)

- Session:
. Fixed bug GH-23056 (missing handler name in session write warning).
(lazerg)

- Zip:
. Fixed bug GH-17787 (ZipArchive stream stops reading early when the archive
is freed while the stream is still open). (Eyüp Can Akman)
Expand Down
2 changes: 2 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ PHP 8.6 UPGRADE NOTES

- Core:
. Using "namespace" as a class constant name is deprecated.
. Using the return statement in a finally block is now deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_returning_from_a_finally_block
. Specifying a return type of array|null / ?array for __debugInfo() is now
deprecated. Specify array instead.
. Returning values from __construct() and __destruct() is now deprecated.
Expand Down
3 changes: 2 additions & 1 deletion Zend/tests/exit_finally_3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ function test() {
var_dump(test());

?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
Exit
3 changes: 2 additions & 1 deletion Zend/tests/gc/gc_050.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ for ($i = 0; $i < 100000; $i++) {
}
echo "OK\n";
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
OK
3 changes: 2 additions & 1 deletion Zend/tests/generators/finally/return_return.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ $gen = gen();
$gen->rewind(); // force run

?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
before return
before return in inner finally
outer finally run
3 changes: 2 additions & 1 deletion Zend/tests/generators/finally/yield_return.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ foreach (foo(1, 5) as $x) {
echo $x, "\n";
}
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
1
3 changes: 2 additions & 1 deletion Zend/tests/generators/get_return_and_finally.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ try {
}

?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
int(42)
gen2() throw
Cannot get return value of a generator that hasn't returned
3 changes: 2 additions & 1 deletion Zend/tests/generators/gh11028_1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ test("false", false);
test("true", true);
test("object", new stdClass);
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
yield null
Keys must be of type int|string during array unpacking
yield false
Expand Down
2 changes: 2 additions & 0 deletions Zend/tests/generators/gh11028_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ $c = (function () {
})()[0];
?>
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d

Warning: Undefined variable $a in %s on line %d

Fatal error: Uncaught Error: Keys must be of type int|string during array unpacking in %s:%d
Expand Down
3 changes: 2 additions & 1 deletion Zend/tests/generators/gh11028_3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ try {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
exception
3 changes: 2 additions & 1 deletion Zend/tests/generators/yield_in_finally_cleanup.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ gen4()->rewind();

?>
===DONE===
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
===DONE===
2 changes: 2 additions & 0 deletions Zend/tests/oss_fuzz_438780145.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ test();

?>
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d

Fatal error: Uncaught TypeError: test(): Return value must be of type int, string returned in %s:%d
Stack trace:
#0 %s(%d): test()
Expand Down
2 changes: 2 additions & 0 deletions Zend/tests/return_types/029.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ function foo() : array {
foo();
?>
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d

Fatal error: Uncaught Exception: xxxx in %s:%d
Stack trace:
#0 %s(%d): foo()
Expand Down
2 changes: 2 additions & 0 deletions Zend/tests/return_types/never_finally_return.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ function foo() : never {
// Note the lack of function call: function validated at compile-time
?>
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d

Fatal error: A never-returning function must not return in %s on line %d
3 changes: 2 additions & 1 deletion Zend/tests/try/bug70228.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ function foo() {

var_dump(foo());
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
string(2) "bb"
3 changes: 2 additions & 1 deletion Zend/tests/try/bug70228_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ function test() {

var_dump(test());
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
int(42)
3 changes: 2 additions & 1 deletion Zend/tests/try/bug70228_3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ try {
} while ($e);
}
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
2
1
3 changes: 2 additions & 1 deletion Zend/tests/try/bug70228_4.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ try {
} while ($e);
}
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
1
3 changes: 2 additions & 1 deletion Zend/tests/try/bug70228_6.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ function test($x) {

var_dump(test([1]));
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
int(42)
5 changes: 4 additions & 1 deletion Zend/tests/try/catch_finally_003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ function &bar($a) {
var_dump(foo("para"));
var_dump(bar("para"));
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d

Deprecated: Returning from a finally block is deprecated in %s on line %d
string(3) "try"
string(7) "finally"
string(7) "finally"
Expand Down
3 changes: 2 additions & 1 deletion Zend/tests/try/catch_finally_005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ function foo ($a) {

var_dump(foo("para"));
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
int(3)
3 changes: 2 additions & 1 deletion Zend/tests/try/catch_finally_006.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ try {
var_dump($e->getMessage());
}
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
string(4) "para"
string(7) "finally"
string(6) "return"
3 changes: 2 additions & 1 deletion Zend/tests/try/finally_goto_005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ label: try {
}

?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
success
86 changes: 86 additions & 0 deletions Zend/tests/try/finally_return_deprecation.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
--TEST--
Returning from a finally block is deprecated
--FILE--
<?php

function withValue() {
try {
} finally {
return 1;
}
}

function withoutValue() {
try {
} finally {
return;
}
}

// Not deprecated: the return belongs to the try block, not the finally.
function inTry() {
try {
return 1;
} finally {
}
}

// Not deprecated: the return belongs to a catch block.
function inCatch() {
try {
throw new Exception();
} catch (Exception $e) {
return 1;
} finally {
}
}

// Not deprecated: the return belongs to a nested closure, not the finally.
function nestedClosure() {
try {
} finally {
$f = function () {
return 1;
};
}
}

// Deprecated twice: both returns are lexically inside the outer finally, even
// though one of them sits in a nested try block.
function nestedTry() {
try {
} finally {
try {
return 1;
} finally {
return 2;
}
}
}

// Deprecated once: only the closure's own finally return is flagged. The outer
// finally must not leak into the closure, so the closure's try return is left alone.
function closureWithTry() {
try {
} finally {
$f = function () {
try {
return 1;
} finally {
return 2;
}
};
}
}

?>
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d

Deprecated: Returning from a finally block is deprecated in %s on line %d

Deprecated: Returning from a finally block is deprecated in %s on line %d

Deprecated: Returning from a finally block is deprecated in %s on line %d

Deprecated: Returning from a finally block is deprecated in %s on line %d
3 changes: 2 additions & 1 deletion Zend/tests/try/try_catch_finally_003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ function foo () {

var_dump(foo());
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
1234int(4)
3 changes: 2 additions & 1 deletion Zend/tests/try/try_finally_013.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function foo() {

foo();
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
try
finally
3 changes: 2 additions & 1 deletion Zend/tests/try/try_finally_014.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function foo() {

foo();
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
try
finally
3 changes: 2 additions & 1 deletion Zend/tests/try/try_finally_021.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ foreach ([0] as $_) {
}
}
?>
--EXPECT--
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
ok
ok
1 change: 1 addition & 0 deletions Zend/tests/try/try_finally_023.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ try {

?>
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
Exception: 1 in %s:%d
Stack trace:
#0 %s(%d): test()
Expand Down
1 change: 1 addition & 0 deletions Zend/tests/try/try_finally_027.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ try {

?>
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
Exception: 1 in %s:%d
Stack trace:
#0 %s(%d): test()
Expand Down
Loading