#42503 [Bgs]: switch case matching
| From: | bjori@php.net | Date: | Fri, 31 Aug 2007 18:16:06 +0000 |
| Subject: | #42503 [Bgs]: switch case matching | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-116948@lists.php.net to get a copy of this message | ||
ID: 42503
Updated by: bjori@php.net
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] bjori@php.net
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