ID: 42503 Updated by: [EMAIL PROTECTED] Reported By: aya at eh dot org Status: Bogus Bug Type: Feature/Change Request Operating System: Irrelevant PHP Version: 5.2.4 New Comment:
(strict checking would break billions of scripts out there, so this wont change) Previous Comments: ------------------------------------------------------------------------ [2007-08-31 18:15:14] [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 switch/case doesn't do strict checks ------------------------------------------------------------------------ [2007-08-31 18:08:01] aya at eh dot org Description: ------------ What are the chances of changing the way in which switch case-matching works, from a '=='-equivalent to a '==='-equivalent? Alternatively, how about a huge warning on the manual page for the switch statement for people who might reasonably expect that the attached code would act in a sane fashion? Reproduce code: --------------- switch (null) { case 0: echo "PHP case-matching is brain-damaged.\n"; break; case null: echo "PHP case-matching is sane.\n"; break; } Expected result: ---------------- PHP case-matching is sane. Actual result: -------------- PHP case-matching is brain-damaged. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42503&edit=1