#36195 [NEW]: Variable should be $i not i

From: Date: Sat, 28 Jan 2006 22:06:31 +0000
Subject: #36195 [NEW]: Variable should be $i not i
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-30514@lists.php.net to get a copy of this message
From: djshuman at yahoo dot com Operating system: Any PHP version: Irrelevant PHP Bug Type: Website problem Bug description: Variable should be $i not i Description: ------------ To graph correctly from + or - zero the i variable must be changed to $i. Old ====> $min_x = $graph_x[i]; New ====> $min_x = $graph_x[$i]; Reproduce code: --------------- help at nanomc dot com 08-Nov-2005 02:29 // A simple XY graph <html> <head> <title>XY Graph</title> <h2>Practice XY Graph</h2> </head> <body> <?php $left = 0; $top = 0; $x_size = 400; $y_size = 400; $char_width = 8; $char_height = 11; $x_start = $x_left + 100; $y_start = $top + $char_height * 1.5; $x_end = $x_start + $x_size; $y_end = $y_start + $y_size; $right = $x_start + $x_size + 40; $bottom = $y_start + $y_size + $char_height * 1.5; $graph_n = 100; for($i = 0; $i < $graph_n; $i++ ) { $graph_x[$i] = $i; $graph_y[$i] = $i * $i; } $min_x = 9e99; $min_y = 9e99; $max_x = -9e99; $max_y = -9e99; $avg_y = 0.0; for($i = 0; $i < $graph_n; $i++ ) { if( $graph_x[$i] < $min_x ) New ======> $min_x = $graph_x[i]; -- Edit bug report at http://bugs.php.net/?id=36195&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36195&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36195&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36195&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36195&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36195&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36195&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36195&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36195&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36195&r=support Expected behavior: http://bugs.php.net/fix.php?id=36195&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36195&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36195&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36195&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36195&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36195&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36195&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36195&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36195&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36195&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36195&r=mysqlcfg

« previous php.mirrors (#30514) next »