|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-11-21 18:13 UTC] thies at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 11 09:00:02 2026 UTC |
This short script <?php $kbytes = 1024; $values[0] = 1030264522; $values[1] = 1292157002; for ( $i=0 ; $i<count($values) ; $i++ ) print "values[$i] = " . $values[$i] . "\n"; while ( ( $max = max ( $values ) ) > $kbytes ) { print "max = $max\n"; for ( $i=0 ; $i<count($values) ; $i++ ) if ( isset ( $values[$i] ) ) { $values[$i] /= $kbytes; print "values[$i] = " . $values[$i] . "\n"; } } print "max = $max\n"; ?> outputs the following values: values[0] = 1030264522 values[1] = 1292157002 max = 1292157002 values[0] = 1006117.6972656 values[1] = 1261872.0722656 max = 1261872.0722656 values[0] = 982.53681373596 values[1] = 1232.2969455719 max = 1232.2969455719 values[0] = 0.95950860716403 values[1] = 1.2034149859101 max = 0.95950860716403 All but the last max value are correct! (PHP3 gives the correct value)