ID: 50331 Updated by: der...@php.net Reported By: wdolek at gmail dot com Status: Open Bug Type: Feature/Change Request Operating System: GNU/Linux PHP Version: 5.2.11 New Comment:
I wouldn't mind kicking this out in PHP 6 either... Previous Comments: ------------------------------------------------------------------------ [2009-11-30 10:28:09] wdolek at gmail dot com Description: ------------ when using undefined constant, PHP consider name of constant to be string. when using this constant in if () or anywhere else, string value is cast as TRUE, which could confuse developer Reproduce code: --------------- // define('MY_DEFINED_CONSTANT', FALSE); if (MY_DEFINED_CONSTANT) { echo 'value of constant is TRUE'; } else { echo 'value of constant is FALSE'; } Expected result: ---------------- * error or at least warning, that we are using undefined constant * Actual result: -------------- value of constant is TRUE ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50331&edit=1