mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
0b1d750d91
Closes GH-9301
23 lines
226 B
PHP
23 lines
226 B
PHP
--TEST--
|
|
Global can override static variable
|
|
--FILE--
|
|
<?php
|
|
|
|
function foo() {
|
|
static $a = 42;
|
|
var_dump($a);
|
|
global $a;
|
|
$a = 41;
|
|
var_dump($a);
|
|
}
|
|
|
|
foo();
|
|
foo();
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(42)
|
|
int(41)
|
|
int(42)
|
|
int(41)
|