xref: /PHP-5.6/Zend/tests/bug63111.phpt (revision 4db74b7f)
1--TEST--
2Bug #63111 (is_callable() lies for abstract static method)
3--FILE--
4<?php
5abstract class Foo {
6        abstract static function bar();
7}
8interface MyInterface {
9    static function bar();
10}
11abstract class Bar {
12	static function foo() {
13		echo "ok\n";
14	}
15}
16var_dump(is_callable(array("Foo", "bar")));
17var_dump(is_callable("Foo::bar"));
18var_dump(is_callable(array("MyInterface", "bar")));
19var_dump(is_callable("MyInterface::bar"));
20var_dump(is_callable(array("Bar", "foo")));
21var_dump(is_callable("Bar::foo"));
22Bar::foo();
23Foo::bar();
24?>
25--EXPECTF--
26Strict Standards: Static function Foo::bar() should not be abstract in %sbug63111.php on line 3
27bool(false)
28bool(false)
29bool(false)
30bool(false)
31bool(true)
32bool(true)
33ok
34
35Fatal error: Cannot call abstract method Foo::bar() in %sbug63111.php on line 20
36
37