Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Zend/zend_builtin_functions.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_builtin_functions_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions ext/opcache/tests/zend_version.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--TEST--
zend_version() should be evaluated at compile time
--EXTENSIONS--
opcache
--INI--
opcache.enable_cli=1
opcache.opt_debug_level=0x20000
--FILE--
<?php

$v = zend_version();
var_dump($v);

?>
--EXPECTF--
$_main:
; (lines=5, args=0, vars=1, tmps=%d)
; (after optimizer)
; %s.php:%s
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"
Loading