PHP 4.0 Bug #9202 Updated: Parse error when using terniary (?:) and unset()
| From: | mlr at mijoheto dot com | Date: | Sat, 10 Feb 2001 03:45:12 +0000 |
| Subject: | PHP 4.0 Bug #9202 Updated: Parse error when using terniary (?:) and unset() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-46124@lists.php.net to get a copy of this message | ||
ID: 9202
User Update by: mlr@mijoheto.com
Status: Open
Old-Bug Type: Scripting Engine problem
Bug Type: Documentation problem
Description: Parse error when using terniary (?:) and unset()
The documentation for Unset() states:
Description
int unset (mixed var [, mixed var [, ...]])
unset() destroys the specified variables and returns true.
I have changed the type of this bug report to "Documentation Problem", since I have been
informed that Unset is not a function.
<?
$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
Previous Comments:
---------------------------------------------------------------------------
[2001-02-09 20:29:34] mlr@mijoheto.com
<?
$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
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=9202