Re: PHP 4.0 Bug #9202: Parse error when using terniary (?:) and unset()
| From: | Zeev Suraski | Date: | Sat, 10 Feb 2001 02:52:29 +0000 |
| Subject: | Re: PHP 4.0 Bug #9202: Parse error when using terniary (?:) and unset() | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-46122@lists.php.net to get a copy of this message | ||
unset() is not a function, but a statement. It returns no value, and thus, you can't use it as an expression for the ? operator.
Zeev
At 03:29 10/2/2001, mlr@mijoheto.com wrote:
-- Zeev Suraski <zeev@zend.com> CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/From: mlr@mijoheto.comOperating system: Linux 2.2.14-5.0smpPHP version: 4.0.3pl1 PHP Bug Type: Scripting Engine problemBug description: Parse error when using terniary (?:) and unset() <? $avariable = "test"; $avariable=="test" ? $avariable .=" No problem with is_bool" : is_bool($avariable); $avariable=="test" ? $avariable .=" No problem with isset" : isset($avariable); $avariable=="test" ? $avariable .=" No problem with empty" : empty($avariable); $avariable=="test" ? $avariable .=" Problem with unset" : unset($avariable); echo $avariable; ?> Output is Parse error: parse error in /home/httpd/html/mlr/unsetProblem.php on line 6 -- Edit Bug report at: http://bugs.php.net/?id=9202&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net