blob: 794dbd73b4019e2585563c048ff24e4d6fac830e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
--TEST--
Bug #26802 (Can't call static method using a variable)
--FILE--
<?php
function func() {
echo __METHOD__ . "\n";
}
function work() {
echo __METHOD__ . "\n";
}
$function = 'func';
$function();
class foo
{
static $method = 'func';
static public function bar() {
echo __METHOD__ . "\n";
}
static public function func() {
echo __METHOD__ . "\n";
}
}
foo::bar();
$static_method = "foo::bar";
$static_method();
/* The following is a BC break with PHP 4 where it would
* call foo::fail. In PHP 5 we first evaluate static class
* properties and then do the function call.
*/
$method = 'fail';
foo::$method();
?>
===DONE===
--EXPECT--
func
foo::bar
foo::bar
func
===DONE===
|