ZE2 / PHP 5 BC breaking suggestion

From: Date: Sun, 09 Jun 2002 19:29:10 +0000
Subject: ZE2 / PHP 5 BC breaking suggestion
Groups: php.qa 
Request: Send a blank email to php-qa+get-5512@lists.php.net to get a copy of this message
Hi, I know it's BC-breaking, but frankly - I do think it should be changed. The following: <?php if(UNDEFINED_CONSTANT) {
        //do stuff
} ?> will result in do stuff being executed. I think it should be changed. Technically, anything not within quotes is not a string. PHP however defaults to the string type when the characters are not in get_defined_constants(). This leads to unexpected behavior and people that do know, need to code: if(defined('SETTING_TRUE') && SETTING_TRUE)) which defeats using a constant in the first place. Comments please - especially if you know of a widely used php-package, which will break when this is changed. Met vriendelijke groeten / With kind regards, IDG.nl Melvyn Sopacua Webmaster

« previous php.qa (#5512) next »