xref: /PHP-5.5/Zend/tests/objects_027.phpt (revision af05ce0a)
1--TEST--
2Testing 'new static;' calling parent method
3--FILE--
4<?php
5
6class bar {
7	public function show() {
8		var_dump(new static);
9	}
10}
11
12class foo extends bar {
13	public function test() {
14		parent::show();
15	}
16}
17
18$foo = new foo;
19$foo->test();
20$foo::test();
21
22call_user_func(array($foo, 'test'));
23call_user_func(array('foo', 'test'));
24
25?>
26--EXPECTF--
27object(foo)#%d (0) {
28}
29
30Strict Standards: Non-static method foo::test() should not be called statically in %s on line %d
31
32Strict Standards: Non-static method bar::show() should not be called statically in %s on line %d
33object(foo)#%d (0) {
34}
35object(foo)#%d (0) {
36}
37
38Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method foo::test() should not be called statically in %s on line %d
39
40Strict Standards: Non-static method bar::show() should not be called statically in %s on line %d
41object(foo)#%d (0) {
42}
43
44
45