ForeachUniqueTest

Create an array without duplicates from a range using foreach and keys as values


<?php 

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

$this->start($loop);

$unique = array();

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

$unique array_keys($unique);

return 
$this->end();
PHP Loops Seconds Percent
8.3.10 100.000 0.008033 +141%
8.3.9 100.000 0.007683 +135%
7.3.33 100.000 0.007106 +125%
7.3.31 100.000 0.006694 +117%
7.3.30 100.000 0.006845 +120%
7.3.29 100.000 0.006821 +120%
7.3.28 100.000 0.007107 +125%
7.3.27 100.000 0.008398 +147%
7.3.24 100.000 0.007562 +133%
7.3.23 100.000 0.008155 +143%
7.3.22 100.000 0.007524 +132%
7.3.19 100.000 0.008176 +143%
7.3.18 100.000 0.006704 +118%
7.3.17 100.000 0.007201 +126%
7.3.16 100.000 0.006118 +107%
7.3.15 100.000 0.006423 +113%
7.3.14 100.000 0.007236 +127%
7.3.13 100.000 0.006652 +117%
7.3.12 100.000 0.005892 +103%
7.3.11 100.000 0.007186 +126%
7.3.9 100.000 0.007495 +131%
7.3.8 100.000 0.007794 +137%
7.2.30 100.000 0.006708 +118%
8.3.10 10.000 0.001461 +208%
7.2.34 100.000 0.007292 +128%
7.2.33 100.000 0.008323 +146%
7.2.31 100.000 0.007537 +132%
7.2.29 100.000 0.006416 +112%
7.2.28 100.000 0.006229 +109%
7.2.27 100.000 0.007382 +129%
7.2.26 100.000 0.006032 +106%
7.2.25 100.000 0.005705 100%
7.2.24 100.000 0.006716 +118%
7.2.22 100.000 0.007625 +134%
7.2.21 100.000 0.007282 +128%
7.1.33 100.000 0.006913 +121%
7.1.32 100.000 0.007858 +138%
7.1.31 100.000 0.007611 +133%
7.1.0 100.000 0.035017 +614%
7.0.33 100.000 0.007435 +130%
7.0.7 100.000 0.034897 +612%
5.6.40 100.000 0.016102 +282%
5.6.22 100.000 0.077490 +1358%
5.5.36 100.000 0.083009 +1455%
5.4.45 100.000 0.074304 +1302%
5.3.29 100.000 0.193403 +3390%
8.3.9 10.000 0.001330 +189%
8.0.30 100.000 0.007286 +128%
8.0.29 100.000 0.006201 +109%
8.0.28 100.000 0.006078 +107%
8.0.27 100.000 0.006511 +114%
8.0.26 100.000 0.006408 +112%
8.0.25 100.000 0.006395 +112%
8.0.24 100.000 0.006199 +109%
8.0.23 100.000 0.006707 +118%
8.0.20 10.000 0.000901 +128%
8.0.20 100.000 0.006462 +113%
8.0.19 10.000 0.001419 +202%
8.0.19 100.000 0.006173 +108%
8.0.17 10.000 0.001461 +208%
8.0.17 100.000 0.006665 +117%
8.0.16 10.000 0.001719 +245%
8.0.16 100.000 0.009184 +161%
8.0.14 10.000 0.001494 +213%
8.0.14 100.000 0.006968 +122%
8.0.11 100.000 0.006460 +113%
8.0.10 100.000 0.007179 +126%
8.0.9 100.000 0.006721 +118%
8.0.8 100.000 0.009198 +161%
8.0.7 100.000 0.006538 +115%
8.0.3 100.000 0.007940 +139%
8.0.2 100.000 0.009770 +171%
8.0.0 100.000 0.007294 +128%
7.4.33 100.000 0.006999 +123%
7.4.32 100.000 0.006199 +109%
7.4.30 100.000 0.006500 +114%
7.4.28 100.000 0.006965 +122%
7.4.27 100.000 0.006981 +122%
7.4.24 100.000 0.007182 +126%
7.4.23 100.000 0.006793 +119%
7.4.22 100.000 0.006587 +115%
8.0.11 10.000 0.001360 +194%
8.0.10 10.000 0.001307 +186%
8.0.0 10.000 0.001505 +214%
7.4.29 100.000 0.006460 +113%
7.4.21 10.000 0.001454 +207%
7.4.21 100.000 0.006324 +111%
7.4.20 10.000 0.001503 +214%
7.4.20 100.000 0.006789 +119%
7.4.16 100.000 0.007580 +133%
7.4.15 100.000 0.009535 +167%
7.4.33 10.000 0.001053 +150%
7.4.32 10.000 0.000960 +137%
7.4.30 10.000 0.001089 +155%
7.4.29 10.000 0.001371 +195%
7.4.24 10.000 0.001452 +207%
7.4.23 10.000 0.001473 +210%
7.4.22 10.000 0.001348 +192%
7.4.13 100.000 0.007135 +125%
7.4.12 100.000 0.009419 +165%
7.4.11 100.000 0.007591 +133%
7.4.10 100.000 0.007630 +134%
8.0.2 10.000 0.002106 +300%
7.4.0 100.000 0.007004 +123%
8.0.30 10.000 0.001127 +160%
8.0.29 10.000 0.000703 100%
8.0.28 10.000 0.000880 +125%
8.0.27 10.000 0.001024 +146%
8.0.26 10.000 0.001075 +153%
8.0.25 10.000 0.000949 +135%
8.0.24 10.000 0.001032 +147%
8.0.23 10.000 0.000898 +128%
8.0.9 10.000 0.001399 +199%
8.0.8 10.000 0.001437 +205%
8.0.7 10.000 0.001370 +195%
8.0.3 10.000 0.001690 +241%
7.4.28 10.000 0.001512 +215%
7.4.27 10.000 0.001611 +229%
7.4.16 10.000 0.001693 +241%
7.4.15 10.000 0.002173 +309%
7.4.13 10.000 0.001423 +203%
7.4.12 10.000 0.001668 +237%
7.4.11 10.000 0.001501 +214%
7.4.10 10.000 0.001616 +230%
7.4.7 10.000 0.001649 +235%
7.4.7 100.000 0.007897 +138%
7.4.6 10.000 0.001296 +184%
7.4.6 100.000 0.006032 +106%
7.4.5 10.000 0.001330 +189%
7.4.5 100.000 0.006388 +112%
7.4.4 10.000 0.001548 +220%
7.4.4 100.000 0.007086 +124%
7.4.3 10.000 0.001314 +187%
7.4.3 100.000 0.006324 +111%
7.4.1 100.000 0.005951 +104%
7.4.2 10.000 0.001754 +250%
7.4.2 100.000 0.006728 +118%
7.4.1 10.000 0.001486 +212%
7.4.0 10.000 0.000943 +134%
7.3.33 10.000 0.001143 +163%
7.3.31 10.000 0.001418 +202%
7.3.30 10.000 0.001428 +203%
7.3.29 10.000 0.001512 +215%
7.3.28 10.000 0.001628 +232%
7.3.27 10.000 0.001800 +256%
7.3.24 10.000 0.001435 +204%
7.3.23 10.000 0.001688 +240%
7.3.22 10.000 0.001580 +225%
7.3.19 10.000 0.001700 +242%
7.3.18 10.000 0.001377 +196%
7.3.17 10.000 0.001421 +202%
7.3.16 10.000 0.001290 +184%
7.3.15 10.000 0.001266 +180%
7.3.14 10.000 0.001811 +258%
7.3.13 10.000 0.001517 +216%
7.3.12 10.000 0.001500 +213%
7.3.11 10.000 0.000951 +135%
7.3.9 10.000 0.000969 +138%
7.3.8 10.000 0.000855 +122%
7.2.34 10.000 0.001300 +185%
7.2.33 10.000 0.001791 +255%
7.2.31 10.000 0.001550 +221%
7.2.30 10.000 0.001173 +167%
7.2.29 10.000 0.001319 +188%
7.2.28 10.000 0.001373 +195%
7.2.27 10.000 0.001597 +227%
7.2.26 10.000 0.001581 +225%
7.2.25 10.000 0.001149 +164%
7.2.24 10.000 0.000966 +137%
7.2.22 10.000 0.000871 +124%
7.2.21 10.000 0.000735 +105%
7.1.33 10.000 0.001272 +181%
7.1.32 10.000 0.000984 +140%
7.1.31 10.000 0.000768 +109%
7.1.0 10.000 0.004008 +570%
7.0.33 10.000 0.001298 +185%
7.0.7 10.000 0.004064 +578%
5.6.40 10.000 0.001907 +271%
5.6.22 10.000 0.008334 +1186%
5.5.36 10.000 0.009053 +1289%
5.4.45 10.000 0.008149 +1160%
5.3.29 10.000 0.018896 +2690%