|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-08-30 09:52 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2014-08-30 09:52 UTC] nikic@php.net
[2014-09-04 20:19 UTC] 1nflktd at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 23:00:01 2026 UTC |
Description: ------------ Defining constants with invalid characters (e.g. leading numbers) are allowed, define() returns true, checking the constant with defined() also returns true, but when you try to use it you have a parse error. Test script: --------------- var_dump ( define ("0000X" , 1) ); var_dump ( defined ("0000X") ); echo 0000X; http://sandbox.onlinephpfunctions.com/code/a7e955c09fbcc9e17a51ea56a75c70f8f60ab7e7 Expected result: ---------------- var_dump ( define ("0000X" , 1) ); // false, throwing an notice or a warning var_dump ( defined ("0000X") ); // false echo 0000X; // Parse error Actual result: -------------- var_dump ( define ("0000X" , 1) ); // true var_dump ( defined ("0000X") ); // true echo 0000X; // Parse error