Re: Make switch/case to type sensitive comparison in PHP 5?
| From: | Joey Smith | Date: | Mon, 24 Mar 2003 13:42:37 +0000 |
| Subject: | Re: Make switch/case to type sensitive comparison in PHP 5? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-209@lists.php.net to get a copy of this message | ||
See also bug 21990.
http://bugs.php.net/lbugs.php?id=21990
On Mon, Mar 24, 2003 at 06:07:02AM -0700, Joey Smith wrote:
> I was reminded tonight of the following 'feature' of switch:
>
> $a = 0;
> switch($a) {
> case 'somestring': echo 'Bug?'; break;
> case 0: echo 'Not a bug'; break;
> }
>
> This will echo 'Bug?' with PHP 4. It seems more logical to have switch
> comparing with T_IS_IDENTICAL than with T_IS_EQUAL. Is this something that
> might be changed as we move to PHP 5.0?
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php