From d100caa476f62a9f6576dcf2c5d8dbb88ed9c57e Mon Sep 17 00:00:00 2001 From: Gina Peter Bnayard Date: Wed, 14 Aug 2024 13:52:07 +0200 Subject: [PATCH] [skip ci] Add NEWS/UPGRADING + wording amendment for GH-13483 --- NEWS | 6 ++++++ UPGRADING | 7 +++++++ build/gen_stub.php | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 2c65e9799ab..f25196e7385 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,12 @@ PHP NEWS - Core: . Exiting a namespace now clears seen symbols. (ilutov) + . The exit (and die) language constructs now behave more like a function. + They can be passed liked callables, are affected by the strict_types + declare statement, and now perform the usual type coercions instead of + casting any non-integer value to a string. + As such, passing invalid types to exit/die may now result in a TypeError + being thrown. (Girgias) 15 Aug 2024, PHP 8.4.0beta1 diff --git a/UPGRADING b/UPGRADING index bcf95365538..438ab25f5c6 100644 --- a/UPGRADING +++ b/UPGRADING @@ -37,6 +37,13 @@ PHP 8.4 UPGRADE NOTES allowed, e.g. $ref = &$this->readonly. This was already forbidden for readonly initialization, and was an oversight in the "readonly reinitialization during cloning" implementation. + . The exit (and die) language constructs now behave more like a function. + They can be passed liked callables, are affected by the strict_types + declare statement, and now perform the usual type coercions instead of + casting any non-integer value to a string. + As such, passing invalid types to exit/die may now result in a TypeError + being thrown. + RFC: https://wiki.php.net/rfc/exit-as-function - DBA: . dba_open() and dba_popen() will now return a Dba\Connection diff --git a/build/gen_stub.php b/build/gen_stub.php index 970214c9419..1d92ddd46b9 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -83,7 +83,7 @@ function processStubFile(string $stubFile, Context $context, bool $includeOnly = } } - /* As exit() and die() are proper token/keywords an need to hack-around */ + /* Because exit() and die() are proper token/keywords we need to hack-around */ $hasSpecialExitAsFunctionHandling = str_ends_with($stubFile, 'zend_builtin_functions.stub.php'); if (!$fileInfo = $context->parsedFiles[$stubFile] ?? null) { initPhpParser();