Hi,
I'd like to propose a new keyword: in. It should work like the
SQL-in-expression.
For example you have a variable $val and want to test whether it
contains e.g. 1 or 2 or 99.
At the moment I would choose between on of the following
code-constructs:
1.) if ($var == 1 ||
$var == 2 ||
$var == 99) { // ...
2.) if (in_array ($var, array (1, 2, 99)) { // ...
What about adopting such a keyword as in to be able to write the
following code:
if ($var in (1, 2, 99)) { // ...
Well, at least I find it quite elegant. :)
I'd appreciate any comments.
Alex
--
Alex Kiesel PGP Key: 0x09F4FA11
Todays excuse: Secretary sent chain letter to all 5000 employees.
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php