This may sound like a screwed up idea, and I'm not even sure if I would 
support it, but just something that went through my mind:

A 2nd (flag) parameter for switch could do miracles:

switch ($var, SWITCH_STRICT)
{
}

and could be used for more than just strict checks:

switch ($var, SWITCH_STRICT | SWITCH_REGEXP)
{
  case '/^[0-9]+$/': echo 'a number'; break;
}

or perhaps with byte-flags like with fopen():

switch ($var, 'r')
{
  case '/^[0-9]+$/': echo 'a number'; break;
}

Just an idea, and perhaps gross, but very practical if you ask me.

- Ron



"Stefan Walk" <[EMAIL PROTECTED]> schreef in bericht 
news:[EMAIL PROTECTED]
See http://bugs.php.net/bug.php?id=23110

It's definitely a gotcha, especially if you use switch(){}, as there
is no way to do strict type checking there.

Regards,
Stefan 

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

Reply via email to