#47363 [NEW]: for($i=4;$i<((func_num_args() + sizeof($array)));$i++) does not work.
| From: | devilx at devilx dot net | Date: | Thu, 12 Feb 2009 04:15:17 +0000 |
| Subject: | #47363 [NEW]: for($i=4;$i<((func_num_args() + sizeof($array)));$i++) does not work. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-133753@lists.php.net to get a copy of this message | ||
From: devilx at devilx dot net
Operating system: Linux, Mac OS X
PHP version: 5.2.9RC1
PHP Bug Type: Arrays related
Bug description: for($i=4;$i<((func_num_args() + sizeof($array)));$i++) does not work.
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 bug report at http://bugs.php.net/?id=47363&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47363&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47363&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47363&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=47363&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47363&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=47363&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=47363&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=47363&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=47363&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=47363&r=support
Expected behavior: http://bugs.php.net/fix.php?id=47363&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=47363&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=47363&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=47363&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47363&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47363&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=47363&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=47363&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=47363&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=47363&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=47363&r=mysqlcfg