On Sun, 2003-01-12 at 20:47, Sara Golemon wrote:
[...]
> This has been discussed (recently in fact) and won't be done. However,
> you *can* give your code the type of readability you're looking for with:
>
> ($condition) || {
> /* This will only run if $condition evals to false */
> }
Nope, that gives me a parse error:
thekid@friebes:~ > echo '<? function unless($c) { return $c; } $c=
FALSE; unless($c) || print("!condition\n"); ?>' | php -q
!condition
thekid@friebes:~ > echo '<? function unless($c) { return $c; } $c=
FALSE; unless($c) || { print("!condition\n"); } ?>' | php -q
Parse error: parse error in - on line 1
It'll work for exactly one statement (e.g. mysql_connect() or die()),
but not with blocks (mysql_connect() or { mail(...); die(); })).
--
Timm Friebe <[EMAIL PROTECTED]>
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php