xref: /php-src/Zend/tests/bug70164.phpt (revision d30cd7d7)
1--TEST--
2__COMPILER_HALT_OFFSET__ is a "magic" constant, which should work if referenced directly, even in a namespace
3--FILE--
4<?php
5
6namespace {
7    echo __COMPILER_HALT_OFFSET__, "\n";
8    echo \__COMPILER_HALT_OFFSET__, "\n";
9}
10
11namespace Foo {
12    echo __COMPILER_HALT_OFFSET__, "\n";
13    echo \__COMPILER_HALT_OFFSET__, "\n";
14    echo namespace\__COMPILER_HALT_OFFSET__, "\n";
15
16}
17
18__halt_compiler();
19
20?>
21--EXPECTF--
22%d
23%d
24%d
25%d
26
27Fatal error: Uncaught Error: Undefined constant "Foo\__COMPILER_HALT_OFFSET__" in %s:%d
28Stack trace:
29#0 {main}
30  thrown in %s on line %d
31