RE: [PHP4BETA] A strict equality operator
| From: | Brian Schaffner | Date: | Mon, 26 Jul 1999 23:00:56 +0000 |
| Subject: | RE: [PHP4BETA] A strict equality operator | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-2824@lists.php.net to get a copy of this message | ||
> would be a good thing to start them now... I also find it
> difficult to
> relate to the old fortran days :)
fortran - what's that? ;-)
> I think that if we try to put things in order, we basically have the
> =~= / =:=
> approach, and the
> [=] approach
>
> I personally think that visually, [=] doesn't look right
> since it looks
> just like an array offset, and in a way, as an expression in itself
> (enclosed by parentheses). It could be just me though.
>
> I think I like =~= best.
i like having the equals on the inside because it will allow us to add less
than, greater than, and not equals in the future (or whenever). i also like
the visual of [=] because it focuses the attention on the equals rather than
obfuscating the code (as I feel =~= does).
here's some code to illustrate these:
if ($zeev [=] $andi) ...
if ($jim =~= $rasmus + $caffeine) ...
while ($php3[$n] [<] $php4[$n]) ...
yuck - how do we handle !=== ? is it !=~!= or =!~= ?
of course:
if ($zeev->choice [!=] "[=]") ...
^^^
hrmm... what does the parser think about that space?
for ($i = 0; $i !=:= count($developers); $i++) ...
if ($i <:< $j) ...
if ($deadhorse =:= $beat_to_death) exit;
i would assume that the <, >, and != should all be part of this. this
assumption is based on another assumption that these expressions should be
quicker than the standard =, <, >, != because no type conversion is
necessary before the comparison.
-brian-