array_push
| From: | Michal Dvoracek | Date: | Tue, 27 Aug 2002 09:55:31 +0000 |
| Subject: | array_push | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-114236@lists.php.net to get a copy of this message | ||
Hello,
why this array_push($x ? $a : $b, 'value'); produce error(Fatal error:
Only variables can be passed by reference)
<?php
$x = 1;
#$x = 0;
$a = array();
$b = array();
array_push($x ? $a : $b, 'value');
i must rewrote this in
if ($x)
array_push($a, 'value');
else
array_push($b, 'value');
Regards,
Michal Dvoracek michal.dvoracek@capitol.cz