note 30714 added to language.types.array
| From: | chroniton dot at dot gmx dot dot dot li at rack1 dot php dot net | Date: | Wed, 26 Mar 2003 16:13:45 +0000 |
| Subject: | note 30714 added to language.types.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45852@lists.php.net to get a copy of this message | ||
I didn't find this anywhere in the docs and i think it is worth a mention:
$a[] = &$a;
print_r($a);
// will output:
/*
Array
(
[0] => Array
*RECURSION*
)
*/
// this means that $a[0] is a reference to $a ( that is detected by print_r() ). I guess this is
what the manual calls 'recursive arrays'.
--
http://www.php.net/manual/en/language.types.array.php
http://master.php.net/manage/user-notes.php?action=edit+30714
http://master.php.net/manage/user-notes.php?action=delete+30714
http://master.php.net/manage/user-notes.php?action=reject+30714