constant are case insensitive as opposed to what the manual says.
| From: | Flavien LEBARBE | Date: | Thu, 06 Apr 2000 18:08:08 +0000 |
| Subject: | constant are case insensitive as opposed to what the manual says. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-17686@lists.php.net to get a copy of this message | ||
from the manual :
" The optional third parameter case_insensitive is also available.
If the value 1 is given, then the constant will be defined case-insensitive.
The default behaviour is case-sensitive; i.e. CONSTANT and Constant
represent different values. "
Example :
<?php
define ("CONSTANT",1);
define ("Constant",2);
echo 'CONSTANT='.CONSTANT."<BR>\n";
echo 'Constant='.Constant."<BR>\n";
?>
output :
CONSTANT=1
Constant=Constant
I had a look at the code and discovered that zend_register_constant and
zend_get_constant translate constant names to lowercase before working
on them.
Should the documentation be changed according to the behaviour, or should
the behaviour be changed ?
Flavien Lebarbé
--
Flavien LEBARBE OPEN CARE Support for Freedom
mailto:flebarbe@ocare.com http://www.ocare.com
Tel:+33 141430890 Fax:+33 141430891