<?php function start() { $GLOBALS['start'] = microtime(true); } function stop($return=false) { $time = microtime(true) - $GLOBALS['start']; if($return) { return $time; } else { printf("\n\n%.20f seconds\n\n", $time); } } $ruleMatch = $exclude = true; $itemId = 10000; start(); for($i=0;$i<1000;$i++) { $allowedItems = range(1, 10000); // if ($ruleMatch && $exclude && ($key = array_search($itemId, $allowedItems))!==false) { unset($allowedItems[$key]); } // } stop(); start(); for($i=0;$i<1000;$i++) { $allowedItems = range(1, 10000); // $flipped = array_flip($allowedItems); if ($ruleMatch && $exclude && isset($flipped[$itemId])) { unset($allowedItems[$flipped[$itemId]]); } // } stop();
You have javascript disabled. You will not be able to edit any code.