php-src/Zend/tests/bug53305.phpt
Nikita Popov edf22962ef Make constant redeclaration a warning
We missed the change to make this an Error exception in PHP 8,
but at least elevate it to a warning, to avoid a notice -> exception
jump at a later time.
2020-09-21 17:04:39 +02:00

20 lines
499 B
PHP

--TEST--
Bug #53305 (E_NOTICE when defining a constant starts with __COMPILER_HALT_OFFSET__)
--FILE--
<?php
error_reporting(E_ALL);
define('__COMPILER_HALT_OFFSET__1', 1);
define('__COMPILER_HALT_OFFSET__2', 2);
define('__COMPILER_HALT_OFFSET__', 3);
define('__COMPILER_HALT_OFFSET__1'.chr(0), 4);
var_dump(__COMPILER_HALT_OFFSET__1);
var_dump(constant('__COMPILER_HALT_OFFSET__1'.chr(0)));
?>
--EXPECTF--
Warning: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d
int(1)
int(4)