ForeachUniqueIssetTest

Create an array without duplicates from a range using foreach, checking existing with isset and keys as values


<?php 

$values 
$this->getRangeStrings($loop);

$this->start($loop);

$unique = array();

foreach (
$values as $value) {
    if (!isset(
$unique[$value])) {
        
$unique[$value] = true;
    }
}

$unique array_keys($unique);

return 
$this->end();
PHP Loops Seconds Percent
8.0.30 10.000 0.001080 +155%
8.0.30 100.000 0.007683 +148%
8.0.9 100.000 0.007173 +138%
8.0.8 100.000 0.007211 +139%
7.3.13 100.000 0.006131 +118%
7.3.12 100.000 0.005522 +106%
7.3.11 100.000 0.006807 +131%
7.2.34 100.000 0.006791 +131%
7.2.33 100.000 0.007344 +141%
7.2.31 100.000 0.007051 +136%
7.2.30 100.000 0.006313 +122%
7.2.29 100.000 0.006419 +124%
7.2.28 100.000 0.005880 +113%
7.2.27 100.000 0.006708 +129%
7.2.26 100.000 0.006284 +121%
7.2.25 100.000 0.005192 100%
7.2.24 100.000 0.006739 +130%
7.2.22 100.000 0.007172 +138%
7.2.21 100.000 0.007109 +137%
7.1.33 100.000 0.007218 +139%
7.1.32 100.000 0.008214 +158%
7.1.31 100.000 0.007839 +151%
7.1.0 100.000 0.035353 +681%
7.0.33 100.000 0.006837 +132%
7.0.7 100.000 0.033840 +652%
5.6.40 100.000 0.014452 +278%
5.6.22 100.000 0.073945 +1424%
5.5.36 100.000 0.075086 +1446%
5.4.45 100.000 0.069839 +1345%
5.3.29 100.000 0.080026 +1541%
8.0.29 10.000 0.000952 +137%
8.0.29 100.000 0.006582 +127%
8.0.28 100.000 0.006289 +121%
8.0.27 100.000 0.007186 +138%
8.0.26 100.000 0.007144 +138%
8.0.25 100.000 0.006867 +132%
8.0.24 100.000 0.006616 +127%
8.0.23 100.000 0.005986 +115%
8.0.20 100.000 0.006707 +129%
8.0.19 100.000 0.006370 +123%
8.0.17 100.000 0.007144 +138%
8.0.16 100.000 0.007292 +140%
8.0.14 100.000 0.007193 +139%
8.0.11 10.000 0.001435 +206%
8.0.11 100.000 0.006680 +129%
8.0.10 10.000 0.001409 +203%
8.0.10 100.000 0.006878 +132%
7.3.15 100.000 0.006079 +117%
8.0.28 10.000 0.000901 +129%
8.0.27 10.000 0.001218 +175%
8.0.26 10.000 0.001145 +165%
8.0.25 10.000 0.001051 +151%
8.0.24 10.000 0.000788 +113%
8.0.23 10.000 0.001251 +180%
8.0.20 10.000 0.000955 +137%
8.0.19 10.000 0.001337 +192%
8.0.17 10.000 0.001384 +199%
8.0.16 10.000 0.001373 +197%
8.0.14 10.000 0.001429 +205%
7.3.14 100.000 0.006588 +127%
8.0.9 10.000 0.001439 +207%
8.0.7 100.000 0.006736 +130%
8.0.8 10.000 0.001352 +194%
8.0.3 100.000 0.007979 +154%
8.0.2 100.000 0.010736 +207%
8.0.0 100.000 0.007373 +142%
7.4.33 100.000 0.006254 +120%
8.0.7 10.000 0.001575 +226%
7.4.32 100.000 0.005953 +115%
7.4.30 100.000 0.005743 +111%
7.4.29 100.000 0.005977 +115%
7.4.27 100.000 0.006482 +125%
8.0.3 10.000 0.001779 +256%
7.4.28 100.000 0.006485 +125%
7.4.24 100.000 0.006205 +120%
7.4.7 100.000 0.007268 +140%
7.4.6 100.000 0.005803 +112%
7.4.5 100.000 0.005795 +112%
7.4.4 100.000 0.006996 +135%
8.0.2 10.000 0.001899 +273%
8.0.0 10.000 0.001489 +214%
7.4.3 100.000 0.005767 +111%
7.4.33 10.000 0.000938 +135%
7.4.32 10.000 0.000991 +142%
7.4.30 10.000 0.000857 +123%
7.4.29 10.000 0.001338 +192%
7.3.17 100.000 0.006197 +119%
7.3.16 100.000 0.006233 +120%
7.4.28 10.000 0.001337 +192%
7.4.23 100.000 0.006182 +119%
7.4.21 100.000 0.005705 +110%
7.4.20 100.000 0.006207 +120%
7.4.24 10.000 0.001306 +188%
7.4.16 100.000 0.007134 +137%
7.4.15 10.000 0.002057 +296%
7.4.15 100.000 0.008438 +163%
7.4.13 100.000 0.006545 +126%
7.4.27 10.000 0.001426 +205%
7.4.23 10.000 0.001419 +204%
7.4.22 10.000 0.001258 +181%
7.4.22 100.000 0.006521 +126%
7.4.21 10.000 0.001444 +208%
7.4.20 10.000 0.001329 +191%
7.4.16 10.000 0.001664 +239%
7.4.13 10.000 0.001314 +189%
7.4.12 10.000 0.001506 +217%
7.4.12 100.000 0.008308 +160%
7.4.11 100.000 0.007022 +135%
7.4.11 10.000 0.001520 +219%
7.4.10 10.000 0.001354 +195%
7.4.10 100.000 0.007089 +137%
7.4.7 10.000 0.001515 +218%
7.4.6 10.000 0.001245 +179%
7.4.5 10.000 0.001125 +162%
7.4.4 10.000 0.001467 +211%
7.4.2 10.000 0.001665 +239%
7.4.2 100.000 0.006492 +125%
7.4.3 10.000 0.001315 +189%
7.4.1 10.000 0.001362 +196%
7.4.1 100.000 0.005727 +110%
7.4.0 100.000 0.006586 +127%
7.3.33 100.000 0.006533 +126%
7.3.31 100.000 0.006322 +122%
7.3.18 100.000 0.005893 +114%
7.3.33 10.000 0.001073 +154%
7.3.30 100.000 0.006282 +121%
7.4.0 10.000 0.000877 +126%
7.3.31 10.000 0.001407 +202%
7.3.29 10.000 0.001329 +191%
7.3.29 100.000 0.006443 +124%
7.3.28 10.000 0.001408 +202%
7.3.28 100.000 0.006252 +120%
7.3.27 10.000 0.001710 +246%
7.3.27 100.000 0.007881 +152%
7.3.30 10.000 0.001490 +214%
7.3.24 10.000 0.001352 +194%
7.3.24 100.000 0.007092 +137%
7.3.23 10.000 0.001468 +211%
7.3.23 100.000 0.007720 +149%
7.3.22 10.000 0.001578 +227%
7.3.22 100.000 0.007018 +135%
7.3.19 10.000 0.001559 +224%
7.3.19 100.000 0.007141 +138%
7.3.18 10.000 0.001307 +188%
7.3.17 10.000 0.001388 +199%
7.3.9 10.000 0.000889 +128%
7.3.9 100.000 0.007583 +146%
7.3.8 10.000 0.000803 +115%
7.3.8 100.000 0.007292 +140%
7.3.16 10.000 0.001349 +194%
7.3.15 10.000 0.001256 +181%
7.3.14 10.000 0.001478 +213%
7.3.13 10.000 0.001417 +204%
7.3.12 10.000 0.001293 +186%
7.3.11 10.000 0.001006 +145%
7.2.34 10.000 0.001238 +178%
7.2.33 10.000 0.001630 +234%
7.2.31 10.000 0.001465 +211%
7.2.30 10.000 0.001354 +195%
7.2.29 10.000 0.001336 +192%
7.2.28 10.000 0.001270 +183%
7.2.27 10.000 0.001503 +216%
7.2.26 10.000 0.001406 +202%
7.2.25 10.000 0.001281 +184%
7.2.24 10.000 0.000858 +123%
7.2.22 10.000 0.000812 +117%
7.2.21 10.000 0.000696 100%
7.1.33 10.000 0.001341 +193%
7.1.32 10.000 0.000782 +112%
7.1.31 10.000 0.000834 +120%
7.1.0 10.000 0.004133 +594%
7.0.33 10.000 0.001226 +176%
7.0.7 10.000 0.003976 +572%
5.6.40 10.000 0.001753 +252%
5.6.22 10.000 0.007890 +1134%
5.5.36 10.000 0.008229 +1183%
5.4.45 10.000 0.007607 +1094%
5.3.29 10.000 0.008551 +1229%