ID: 38555 User updated by: php at seven dot net dot nz Reported By: php at seven dot net dot nz Status: Bogus Bug Type: Feature/Change Request Operating System: Irrelevant PHP Version: 5.1.5 New Comment:
Well it may not be a bug per se, but can you tell me why similar language constructs that are used in similar ways behave in an opposite way? Previous Comments: ------------------------------------------------------------------------ [2006-08-23 06:53:44] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php ------------------------------------------------------------------------ [2006-08-23 02:21:24] php at seven dot net dot nz Description: ------------ PHP evaluates an undefined constant as true, whereas it evaluates an undefined variable as false. Reproduce code: --------------- <?= TEST ? '1' : '0' ?><br /> <?= $test ? '1' : '0' ?><br /> Expected result: ---------------- Notice: Use of undefined constant TEST - assumed 'TEST' in test.php on line 1 0 Notice: Undefined variable: test in test.php on line 2 0 Actual result: -------------- Notice: Use of undefined constant TEST - assumed 'TEST' in test.php on line 1 1 Notice: Undefined variable: test in test.php on line 2 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38555&edit=1