diff options
Diffstat (limited to 'Zend/tests/anon/015.phpt')
-rw-r--r-- | Zend/tests/anon/015.phpt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Zend/tests/anon/015.phpt b/Zend/tests/anon/015.phpt new file mode 100644 index 0000000000..f55c4b2605 --- /dev/null +++ b/Zend/tests/anon/015.phpt @@ -0,0 +1,30 @@ +--TEST-- +static variables in methods inherited from parent class +--FILE-- +<?php +class C { + function foo ($y = null) { + static $x = null; + if (!is_null($y)) { + $x = [$y]; + } + return $x; + } +} +$c = new C(); +$c->foo(42); +$d = new class extends C {}; +var_dump($d->foo()); +var_dump($d->foo(24)); +var_dump($c->foo()); +?> +--EXPECT-- +NULL +array(1) { + [0]=> + int(24) +} +array(1) { + [0]=> + int(42) +} |