Edit report at http://bugs.php.net/bug.php?id=54313&edit=1
ID: 54313 Comment by: oop at dr dot com Reported by: oop at dr dot com Summary: What I thought before... Status: Bogus Type: Feature/Change Request Package: Unknown/Other Function PHP Version: Irrelevant Block user comment: N Private report: N New Comment: This is counterintuitive. case_sensitive = true is definitely more straightforward than case_insensitive = false. Previous Comments: ------------------------------------------------------------------------ [2011-03-22 06:33:58] oop at dr dot com scottmac... you are right. shame... ------------------------------------------------------------------------ [2011-03-22 06:20:12] oop at dr dot com Changed Summary ------------------------------------------------------------------------ [2011-03-22 06:04:44] oop at dr dot com Changed Summary ------------------------------------------------------------------------ [2011-03-19 11:53:16] scott...@php.net the flag is case insensitive, not case sensitive ------------------------------------------------------------------------ [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