xref: /PHP-7.3/Zend/tests/bug43651.phpt (revision 7126de49)
1--TEST--
2Bug #43651 (is_callable() with one or more nonconsecutive colons crashes)
3--FILE--
4<?php
5class Test {
6    static function foo() {}
7}
8
9var_dump(is_callable("\\\\"));
10var_dump(is_callable("\\"));
11var_dump(is_callable("x\\"));
12var_dump(is_callable("\\x"));
13var_dump(is_callable("x\\x"));
14var_dump(is_callable("x\\\\"));
15var_dump(is_callable("\\x"));
16var_dump(is_callable("x\\\\x"));
17var_dump(is_callable("cd"));
18var_dump(is_callable("Test\\"));
19var_dump(is_callable("\\Test"));
20var_dump(is_callable("\\Test\\"));
21var_dump(is_callable("Test::foo"));
22var_dump(is_callable("\\Test::foo"));
23var_dump(is_callable("is_string"));
24var_dump(is_callable("\\is_string"));
25--EXPECT--
26bool(false)
27bool(false)
28bool(false)
29bool(false)
30bool(false)
31bool(false)
32bool(false)
33bool(false)
34bool(false)
35bool(false)
36bool(false)
37bool(false)
38bool(true)
39bool(true)
40bool(true)
41bool(true)
42