note 13049 deleted from language.operators.logical.php by zak
| From: | zak@php.net | Date: | Tue, 10 Jul 2001 05:19:42 +0000 |
| Subject: | note 13049 deleted from language.operators.logical.php by zak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15151@lists.php.net to get a copy of this message | ||
>>$choice1 = "";
>>$choice2 = "dog";
>>$default = "other";
>>$val = $choice1 or $choice2 or >>$default;
>>now $val contained the string "dog".
This assignment practice doesn't work on my system (PHP 4.0.5/ISAPI): $val == ''.
Better to use something like:
$val = !empty($choice1) ? $choice1 : $choice2;