ID: 47363 Updated by: scott...@php.net Reported By: devilx at devilx dot net -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: Linux, Mac OS X PHP Version: 5.2.9RC1 New Comment:
The condition is evaluated at the start of each iteration. Also moving the calculation above the loop works. Previous Comments: ------------------------------------------------------------------------ [2009-02-12 14:33:50] smlerman at gmail dot com Try checking the value of sizeof($wuergs) inside the loop. Hint: it changes every time. ------------------------------------------------------------------------ [2009-02-12 04:15:07] devilx at devilx dot net Description: ------------ The Calculation of sizeof + func_num_args within a for does not work / ends in an endless-for. Reproduce code: --------------- f("this","is","a","test"); function f() { $wuergs = array ( 0 => "1234", 1 => "B", 2 => "C", 3 => "D" ); $args=func_get_args(); for($i=4;$i<((func_num_args() + sizeof($wuergs)));$i++) { $wuergs[$i]=$args[$i-4]; } return l_backend($wuergs); } Expected result: ---------------- Moving the content of $args four arrays highr. Actual result: -------------- Endless loop. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47363&edit=1