- Notifications
You must be signed in to change notification settings - Fork8k
Closed
Description
Description
Whenever PHP processes more then one__halt_compiler()
statement in one session, it emits this cryptic warning:
PHP Warning: Constant already defined in ...
Note the empty constant name.
There are several ways to trigger this. Here's one:
# echo '<?php __halt_compiler();' >inc.php# php -aphp > include('inc.php');php > include('inc.php');PHP Warning: Constant already defined in /tmp/inc.php on line 1
Here's another:
# php -r "eval('?><?php __halt_compiler();'); eval('?><?php __halt_compiler();');"
PHP Version
PHP 8.4.5 (cli) (built: Mar 12 2025 16:58:15) (NTS)Copyright (c) The PHP GroupZend Engine v4.4.5, Copyright (c) Zend Technologies
Operating System
No response