mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
7aacc705d0
Closes GH-5958
32 lines
629 B
PHP
32 lines
629 B
PHP
--TEST--
|
|
Bug #42820 (defined() on constant with namespace prefixes tries to load class)
|
|
--FILE--
|
|
<?php
|
|
namespace ns;
|
|
const ok = 0;
|
|
class foo {
|
|
const ok = 0;
|
|
}
|
|
var_dump(defined('ns\\ok'));
|
|
var_dump(defined('ns\\bug'));
|
|
var_dump(defined('\\ns\\ok'));
|
|
var_dump(defined('\\ns\\bug'));
|
|
var_dump(defined('ns\\foo::ok'));
|
|
var_dump(defined('ns\\foo::bug'));
|
|
var_dump(defined('\\ns\\foo::ok'));
|
|
var_dump(defined('\\ns\\foo::bug'));
|
|
var_dump(defined('ns\\bar::bug'));
|
|
var_dump(defined('\\ns\\bar::bug'));
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
bool(false)
|
|
bool(true)
|
|
bool(false)
|
|
bool(true)
|
|
bool(false)
|
|
bool(true)
|
|
bool(false)
|
|
bool(false)
|
|
bool(false)
|