Bug #14068 Updated: 2 while list each dont work
ID: 14068
Updated by: hholzgra
Reported By: witterstein@web.de
Old Status: Open
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.0.5
New Comment:
you have to reset() the arrays before
the loops start to reset the internal
array pointer (see http://php.net/each)
or better use the foreach loop instead
of while/each
Previous Comments:
------------------------------------------------------------------------
[2001-11-15 06:56:24] witterstein@web.de
<?php
$a[0]="x";
$a[1]="y";
$b[0]="z";
$b[1]="w";
$b[2]="u";
while (list($key,$val)=each($a) )
{
while (list($key2,$val2)=each($b) )
{
print "$key: $val - $key2: $val2<br>";
}
}
?>
'./configure' '--with-mysql' '--with-apache=../apache_1.3.20'
'--with-gd=../gd-1.8.3' '--enable-track-vars'
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14068&edit=1
Thread (5 messages)