# Make switch/case to type sensitive comparison in PH P 5?

- Thread: https://externals.io/message/254
- Original archive: https://news-web.php.net/php.internals/254
- Started by Ford on 2003-03-25T11:27:14+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #254 — Ford — 2003-03-25T11:27:14+00:00

URL: https://externals.io/message/254#254

> -----Original Message-----
> From: Zeev Suraski [mailto:zeev@zend.com]
> Sent: 24 March 2003 17:58
> To: Joey Smith
> 
> At 05:07 24/03/2003, Joey Smith wrote:
> > […]
> have switch
> > […]
> something that
> > […]
> 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: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211

---

## #289 — Zeev Suraski — 2003-03-26T01:46:38+00:00

URL: https://externals.io/message/254#289 · In reply to: #254

At 03:27 25/03/2003, Ford, Mike               [LSS] wrote:
>I'd love to see, say, case_identical for requesting an === comparison, with
>case continuing as before to do an == comparison.

I'd really not love to see it :)  Use an if-else chain of === comparisons 
instead if that's what you really need.

Zeev
