> -----Original Message-----
> From: Zeev Suraski [mailto:[EMAIL PROTECTED]
> Sent: 24 March 2003 17:58
> To: Joey Smith
> 
> At 05:07 24/03/2003, 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?> 
> It's not a 'feature', it's a feature.  It's not likely to 
> change, dynamic 
> type conversion is one of the foundations of PHP.

Well, yes, but we have == and === for other situations, so some sort of
analogue for use in switches would be nice (I've been bitten by this one
more than once myself!).

I'd love to see, say, case_identical for requesting an === comparison, with
case continuing as before to do an == comparison.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to