Annotation of embedaddon/php/Zend/tests/bug42820.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #42820 (defined() on constant with namespace prefixes tries to load class)
3: --FILE--
4: <?php
5: namespace ns;
6: const ok = 0;
7: class foo {
8: const ok = 0;
9: }
10: var_dump(defined('ns\\ok'));
11: var_dump(defined('ns\\bug'));
12: var_dump(defined('\\ns\\ok'));
13: var_dump(defined('\\ns\\bug'));
14: var_dump(defined('ns\\foo::ok'));
15: var_dump(defined('ns\\foo::bug'));
16: var_dump(defined('\\ns\\foo::ok'));
17: var_dump(defined('\\ns\\foo::bug'));
18: var_dump(defined('ns\\bar::bug'));
19: var_dump(defined('\\ns\\bar::bug'));
20: --EXPECT--
21: bool(true)
22: bool(false)
23: bool(true)
24: bool(false)
25: bool(true)
26: bool(false)
27: bool(true)
28: bool(false)
29: bool(false)
30: bool(false)
31:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>