mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
d30cd7d7e7
Closes GH-5590
31 lines
572 B
PHP
31 lines
572 B
PHP
--TEST--
|
|
__COMPILER_HALT_OFFSET__ is a "magic" constant, which should work if referenced directly, even in a namespace
|
|
--FILE--
|
|
<?php
|
|
|
|
namespace {
|
|
echo __COMPILER_HALT_OFFSET__, "\n";
|
|
echo \__COMPILER_HALT_OFFSET__, "\n";
|
|
}
|
|
|
|
namespace Foo {
|
|
echo __COMPILER_HALT_OFFSET__, "\n";
|
|
echo \__COMPILER_HALT_OFFSET__, "\n";
|
|
echo namespace\__COMPILER_HALT_OFFSET__, "\n";
|
|
|
|
}
|
|
|
|
__halt_compiler();
|
|
|
|
?>
|
|
--EXPECTF--
|
|
%d
|
|
%d
|
|
%d
|
|
%d
|
|
|
|
Fatal error: Uncaught Error: Undefined constant "Foo\__COMPILER_HALT_OFFSET__" in %s:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %s on line %d
|