note 111529 added to function.range

From: Date: Fri, 01 Mar 2013 09:58:35 +0000
Subject: note 111529 added to function.range
Groups: php.notes 
Request: Send a blank email to php-notes+get-193760@lists.php.net to get a copy of this message
for is better than range: $time_start = microtime(true); foreach(range(1, 50000) as $val) { echo $val.','; } $time_end = microtime(true); $time = $time_end - $time_start; echo '<br /><br />'.$time.'<br /> <br />'; $time_start = microtime(true); for($i = 1; $i <= 50000; $i++) { echo $i.','; } $time_end = microtime(true); $time = $time_end - $time_start; echo '<br /><br />'.$time.'<br /> <br />'; Range: 0.41276001930237 For: 0.3721399307251 ---- Server IP: 69.147.83.199 Probable Submitter: 188.195.123.62 ---- Manual Page -- http://php.net/manual/en/function.range.php Edit -- https://master.php.net/note/edit/111529 Del: integrated -- https://master.php.net/note/delete/111529/integrated Del: useless -- https://master.php.net/note/delete/111529/useless Del: bad code -- https://master.php.net/note/delete/111529/bad+code Del: spam -- https://master.php.net/note/delete/111529/spam Del: non-english -- https://master.php.net/note/delete/111529/non-english Del: in docs -- https://master.php.net/note/delete/111529/in+docs Del: other reasons-- https://master.php.net/note/delete/111529 Reject -- https://master.php.net/note/reject/111529 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#193760) next »