From 23f4b935236e0b811e85f2c8876c04a538ce0c0c Mon Sep 17 00:00:00 2001 From: Giovanni Giacobbi Date: Thu, 29 Jan 2026 11:58:12 +0100 Subject: [PATCH] gen_stub: Fix compatibility with php 7.4 (in PHP-8.4) (#21076) --- 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 58b846d2cb5..28b168c7264 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);