mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
23 lines
253 B
PHP
23 lines
253 B
PHP
--TEST--
|
|
Static variable initializer with function call
|
|
--FILE--
|
|
<?php
|
|
|
|
function bar() {
|
|
echo "bar() called\n";
|
|
return 'bar';
|
|
}
|
|
|
|
function foo() {
|
|
static $bar = bar();
|
|
echo $bar, "\n";
|
|
}
|
|
|
|
foo();
|
|
foo();
|
|
|
|
?>
|
|
--EXPECT--
|
|
bar() called
|
|
bar
|
|
bar
|