Commit ce7896d514b for php.net
commit ce7896d514b415922b344f58f45471c01de6d4a3
Author: Daniel Scherzer <daniel.e.scherzer@gmail.com>
Date: Wed Aug 12 12:02:19 2026 -0700
Mark `zend_version()` as `@compile-time-eval`
diff --git a/Zend/zend_builtin_functions.stub.php b/Zend/zend_builtin_functions.stub.php
index 1d405587145..16ce7e2be8c 100644
--- a/Zend/zend_builtin_functions.stub.php
+++ b/Zend/zend_builtin_functions.stub.php
@@ -15,7 +15,10 @@ function exit(string|int $status = 0): never {}
/** @alias exit */
function die(string|int $status = 0): never {}
-/** @refcount 1 */
+/**
+ * @refcount 1
+ * @compile-time-eval
+ */
function zend_version(): string {}
/** @forbid-dynamic-calls */
diff --git a/Zend/zend_builtin_functions_arginfo.h b/Zend/zend_builtin_functions_arginfo.h
index b3af43fef34..fc8d8270b01 100644
Binary files a/Zend/zend_builtin_functions_arginfo.h and b/Zend/zend_builtin_functions_arginfo.h differ
diff --git a/ext/opcache/tests/zend_version.phpt b/ext/opcache/tests/zend_version.phpt
index e61a0d46cfc..8f37bdc0535 100644
--- a/ext/opcache/tests/zend_version.phpt
+++ b/ext/opcache/tests/zend_version.phpt
@@ -14,14 +14,12 @@
?>
--EXPECTF--
$_main:
- ; (lines=7, args=0, vars=1, tmps=%d)
+ ; (lines=5, args=0, vars=1, tmps=%d)
; (after optimizer)
; %s.php:%s
-0000 INIT_FCALL 0 %d string("zend_version")
-0001 T1 = DO_ICALL
-0002 ASSIGN CV0($v) T1
-0003 INIT_FCALL 1 %d string("var_dump")
-0004 SEND_VAR CV0($v) 1
-0005 DO_ICALL
-0006 RETURN int(1)
+0000 ASSIGN CV0($v) string("%s")
+0001 INIT_FCALL 1 %d string("var_dump")
+0002 SEND_VAR CV0($v) 1
+0003 DO_ICALL
+0004 RETURN int(1)
string(%d) "%s"