Edit report at http://bugs.php.net/bug.php?id=54313&edit=1
ID: 54313 Updated by: scott...@php.net Reported by: oop at dr dot com Summary: Logical Flaw -Status: Open +Status: Bogus Type: Feature/Change Request Package: Unknown/Other Function PHP Version: Irrelevant Block user comment: N Private report: N New Comment: the flag is case insensitive, not case sensitive Previous Comments: ------------------------------------------------------------------------ [2011-03-19 11:22:26] oop at dr dot com Description: ------------ --- >From manual page: http://www.php.net/function.define#Examples --- <?php define("CONSTANT", "Hello world.",false); echo CONSTANT; // outputs "Hello world." echo Constant; // outputs "Constant" and issues a notice. define("GREETING", "Hello you.", true); echo GREETING; // outputs "Hello you." echo Greeting; // outputs "Hello you." ?> If the case_sensitive is true, why GREETING and Greeting output the same value (Hello you)? Then I put ,false just after "Hello world.", why CONSTANT and Constant output the different values? Plus the echo Constant; does not issue a notice. Test script: --------------- <?php define("CONSTANT", "Hello world.",false); echo CONSTANT; // outputs "Hello world." echo Constant; // outputs "Constant" and issues a notice. define("GREETING", "Hello you.", true); echo GREETING; // outputs "Hello you." echo Greeting; // outputs "Hello you." ?> If the case_sensitive is true, why GREETING and Greeting output the same value (Hello you)? Then I put ,false just after "Hello world.", why CONSTANT and Constant output the different values? Plus the echo Constant; does not issue a notice. Expected result: ---------------- <?php define("CONSTANT", "Hello world.",false); echo CONSTANT; // outputs "Hello world." echo Constant; // outputs "Hello world." define("GREETING", "Hello you.", true); echo GREETING; // outputs "Hello you." echo Greeting; // outputs Greeting ?> Actual result: -------------- <?php define("CONSTANT", "Hello world.",false); echo CONSTANT; // outputs "Hello world." echo Constant; // outputs "Constant" and NEVER issues a notice. define("GREETING", "Hello you.", true); echo GREETING; // outputs "Hello you." echo Greeting; // outputs "Hello you." ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54313&edit=1