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, [EMAIL PROTECTED] wrote:
>From: [EMAIL PROTECTED]
>Operating system: Linux 2.2.14-5.0smp
>PHP version: 4.0.3pl1
>PHP Bug Type: Scripting Engine problem
>Bug 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: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
Zeev Suraski <[EMAIL PROTECTED]>
CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]