xref: /PHP-8.2/Zend/tests/bug63111.phpt (revision f8d79582)
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--
26bool(false)
27bool(false)
28bool(false)
29bool(false)
30bool(true)
31bool(true)
32ok
33
34Fatal error: Uncaught Error: Cannot call abstract method Foo::bar() in %sbug63111.php:20
35Stack trace:
36#0 {main}
37  thrown in %sbug63111.php on line 20
38