Skip to content

Commit d100caa

Browse files
committed
[skip ci] Add NEWS/UPGRADING + wording amendment for GH-13483
1 parent a79c70f commit d100caa

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ PHP NEWS
44

55
- Core:
66
. Exiting a namespace now clears seen symbols. (ilutov)
7+
. The exit (and die) language constructs now behave more like a function.
8+
They can be passed liked callables, are affected by the strict_types
9+
declare statement, and now perform the usual type coercions instead of
10+
casting any non-integer value to a string.
11+
As such, passing invalid types to exit/die may now result in a TypeError
12+
being thrown. (Girgias)
713

814
15 Aug 2024, PHP 8.4.0beta1
915

UPGRADING

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ PHP 8.4 UPGRADE NOTES
3737
allowed, e.g. $ref = &$this->readonly. This was already forbidden for
3838
readonly initialization, and was an oversight in the "readonly
3939
reinitialization during cloning" implementation.
40+
. The exit (and die) language constructs now behave more like a function.
41+
They can be passed liked callables, are affected by the strict_types
42+
declare statement, and now perform the usual type coercions instead of
43+
casting any non-integer value to a string.
44+
As such, passing invalid types to exit/die may now result in a TypeError
45+
being thrown.
46+
RFC: https://wiki.php.net/rfc/exit-as-function
4047

4148
- DBA:
4249
. dba_open() and dba_popen() will now return a Dba\Connection

build/gen_stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function processStubFile(string $stubFile, Context $context, bool $includeOnly =
8383
}
8484
}
8585

86-
/* As exit() and die() are proper token/keywords an need to hack-around */
86+
/* Because exit() and die() are proper token/keywords we need to hack-around */
8787
$hasSpecialExitAsFunctionHandling = str_ends_with($stubFile, 'zend_builtin_functions.stub.php');
8888
if (!$fileInfo = $context->parsedFiles[$stubFile] ?? null) {
8989
initPhpParser();

0 commit comments

Comments
 (0)