php-src/Zend/tests/constants_009.phpt

26 lines
245 B
Plaintext
Raw Normal View History

2008-08-26 03:35:10 +08:00
--TEST--
Accessing constants inside namespace
--FILE--
<?php
2008-12-05 04:12:30 +08:00
namespace foo\x;
2008-08-26 03:35:10 +08:00
const x = 2;
class x {
const x = 1;
}
2008-12-05 04:12:30 +08:00
var_dump(namespace\x,
x::x,
namespace\x::x);
var_dump(defined('foo\x\x'));
2008-08-26 03:35:10 +08:00
?>
--EXPECT--
int(2)
int(1)
int(1)
bool(true)