Arquivos
hhvm/hphp/test/quick/static_vars.php
T
ptarjan 503f75d08b Rename test directories
These names don't make sense now that we run both suites the same
way.
2013-04-17 09:06:51 -07:00

44 linhas
455 B
PHP

<?php
function foo() {
static $a;
$a++;
print "foo $a\n";
}
function bar() {
static $a;
$a += 2;
print "bar $a\n";
}
class A {
private function priv() {
static $x = 0;
$x += 4;
print "A::priv $x\n";
}
function baz() {
static $a;
$a += 4;
print "A::baz $a\n";
$this->priv();
}
}
class B extends A {
}
$a = new A();
$b = new B();
foo();
bar();
$a->baz();
$b->baz();
foo();
bar();
$a->baz();
$b->baz();