Date: 11/01/00
- Next message: Alejandro López: "[PHP-DEV] email"
- Previous message: chrisv <email protected>: "Re: [PHP-DEV] Socket() Error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: mog <email protected>
Operating system: RedHat Linux 7
PHP version: 4.0.1pl2
PHP Bug Type: Arrays related
Bug description: next() and current() do not return referenceing arrays
i hope you can see what is wrong in the code below
<?PHP
$array2 = array(0,1,2);
$array = array(&$array2);
print current(current($array))."<br>"; // returns 0
print "<b>Try 1!</b><br>";
print next(current($array))."<br>"; // returns 1, correct but the internal pointer is only moved in the copy current() returned
print current(current($array))."<br>"; // returns 0, wrong, should be 1
print current($array2)."<br>"; //returns 0, wrong, should be 1
print "<b>Try 2!</b><br>";
print next($array[0])."<br>";
print current(current($array))."<br>"; // returns 0, wrong, should be 1
print current($array[0])."<br>"; // returns 1, yes, correct! but the code above still didn't work!
?>
-- Edit Bug report at: http://bugs.php.net/?id=7578&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Alejandro López: "[PHP-DEV] email"
- Previous message: chrisv <email protected>: "Re: [PHP-DEV] Socket() Error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

