From ed3f419837edb00f05df0863a7f5b7d3ad0ac650 Mon Sep 17 00:00:00 2001 From: Giovanni Giacobbi Date: Thu, 29 Jan 2026 11:06:54 +0100 Subject: [PATCH 1/2] gen_stub: Fix compatibility with php 7.4 --- build/gen_stub.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index 58b846d2cb542..3e8cbe29e9da3 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -84,7 +84,7 @@ function processStubFile(string $stubFile, Context $context, bool $includeOnly = } /* Because exit() and die() are proper token/keywords we need to hack-around */ - $hasSpecialExitAsFunctionHandling = str_ends_with($stubFile, 'zend_builtin_functions.stub.php'); + $hasSpecialExitAsFunctionHandling = (basename($stubFile) == 'zend_builtin_functions.stub.php'); if (!$fileInfo = $context->parsedFiles[$stubFile] ?? null) { initPhpParser(); $stubContent = $stubCode ?? file_get_contents($stubFile); From 4e12fe8f27ee249d7e621bb98031f79796982053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 29 Jan 2026 11:15:09 +0100 Subject: [PATCH 2/2] Remove useless parentheses in gen_stub.php --- build/gen_stub.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index 3e8cbe29e9da3..28b168c72642b 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -84,7 +84,7 @@ function processStubFile(string $stubFile, Context $context, bool $includeOnly = } /* Because exit() and die() are proper token/keywords we need to hack-around */ - $hasSpecialExitAsFunctionHandling = (basename($stubFile) == 'zend_builtin_functions.stub.php'); + $hasSpecialExitAsFunctionHandling = basename($stubFile) == 'zend_builtin_functions.stub.php'; if (!$fileInfo = $context->parsedFiles[$stubFile] ?? null) { initPhpParser(); $stubContent = $stubCode ?? file_get_contents($stubFile);