php-src/Zend/tests/objects_027.phpt

29 lines
365 B
Plaintext
Raw Normal View History

2008-05-12 06:44:56 +08:00
--TEST--
Testing 'new static;' calling parent method
--FILE--
2018-09-17 01:16:42 +08:00
<?php
2008-05-12 06:44:56 +08:00
class bar {
2020-02-04 05:52:20 +08:00
public function show() {
var_dump(new static);
}
2008-05-12 06:44:56 +08:00
}
2018-09-17 01:16:42 +08:00
2008-05-12 06:44:56 +08:00
class foo extends bar {
2020-02-04 05:52:20 +08:00
public function test() {
parent::show();
}
2008-05-12 06:44:56 +08:00
}
2018-09-17 01:16:42 +08:00
2008-05-12 06:44:56 +08:00
$foo = new foo;
$foo->test();
call_user_func(array($foo, 'test'));
?>
--EXPECTF--
object(foo)#%d (0) {
}
2008-07-24 17:42:18 +08:00
object(foo)#%d (0) {
2008-05-12 06:44:56 +08:00
}