2008-05-13 01:55:21 +08:00
|
|
|
--TEST--
|
|
|
|
Trying to access undeclared static property
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
class bar {
|
2020-02-04 05:52:20 +08:00
|
|
|
public function __set($a, $b) {
|
|
|
|
print "hello\n";
|
|
|
|
}
|
2008-05-13 01:55:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
class foo extends bar {
|
2020-02-04 05:52:20 +08:00
|
|
|
public function __construct() {
|
|
|
|
static::$f = 1;
|
|
|
|
}
|
|
|
|
public function __set($a, $b) {
|
|
|
|
print "foo\n";
|
|
|
|
}
|
2008-05-13 01:55:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
new foo;
|
|
|
|
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
2015-05-18 06:31:43 +08:00
|
|
|
Fatal error: Uncaught Error: Access to undeclared static property: foo::$f in %s:%d
|
2015-05-16 03:04:07 +08:00
|
|
|
Stack trace:
|
|
|
|
#0 %s(%d): foo->__construct()
|
|
|
|
#1 {main}
|
|
|
|
thrown in %s on line %d
|