note 41153 deleted from language.variables by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 31 Mar 2004 23:15:09 +0000 |
| Subject: | note 41153 deleted from language.variables by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-67441@lists.php.net to get a copy of this message | ||
Note Submitter: bhook@coder7.com
----
I didn't see it mentioned anywhere, so I figure I would point this out.
<?php
//initializing multiple variables at once does work
$a=$b=$c=5;
echo "a=$a, b=$b, c=$c \n";
//also, initializing multiple arrays works equally well
$a=$b=$c=array(0=>'hello');
print_r($a);
print_r($b);
print_r($c);
//as does initializing array elements
$x[]=$y[3]=$z['cat']='world';
print_r($x);
print_r($y);
print_r($z);
?>