|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-08-10 23:21 UTC] johannes@php.net
-Status: Open
+Status: Bogus
[2010-08-10 23:21 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Mar 30 23:00:01 2026 UTC |
Description: ------------ Constants can be defined with invalid characters in the name. The documentation is correct but there seems to be no validation that matches the docs when the constant's name is assigned to zend_constant.name According to the docs on Constants: The name of a constant follows the same rules as any label in PHP. A valid constant name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thusly: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* Test script: --------------- <?php define('/', 'slash'); echo constant('/'); // works echo /; // parse error as expected ?> Expected result: ---------------- define() should throw an error stating that the constant name has invalid characters in it