note 20106 deleted from function.list by philip
| From: | philip@php.net | Date: | Thu, 28 Mar 2002 01:25:46 +0000 |
| Subject: | note 20106 deleted from function.list by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-28315@lists.php.net to get a copy of this message | ||
It may seem obvious to some, but specifying more variables to assign to than array elements will
result in the excess variables being ignored, i.e. being of NULL type.
For example:
$x = array ("ein", "zwei", 'drei', 'vier');
list ($a, $b, $c) = $x;
echo gettype ($a) . ', ';
echo gettype ($b) . ', ';
echo gettype ($c) . ', ';
echo gettype ($d);
Would output "string, string, string, NULL"
This doesn't appear to produce any errors, though it may produce a low-level warning which
I'm not seeing.