note 37723 deleted from function.current by bjori
| From: | bjori@php.net | Date: | Mon, 24 Apr 2006 15:13:42 +0000 |
| Subject: | note 37723 deleted from function.current by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-109454@lists.php.net to get a copy of this message | ||
Note Submitter: jdpipe at yahoo dot co dot uk
----
You can't get a pointer to an element in an array using the 'current' construct, for
example:
<?php
$a=array();
$a[]='aaa';
$a[]='bbb';
$a[]='ccc';
$a[]='ddd';
$a[]='eee';
reset($a);
next($a);
$v =& current($a);
$v = 'xxxx';
// array is not changed
print_r($a);
next($a);
$v =& $a[key($a)];
$v = 'yyy';
// now the array is changed
print_r($a);
?>