ForeachUniqueInArrayStrictTest

Create an array without duplicates from a range using foreach, checking existing with in_array (strict) and keys as values


<?php 

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

$this->start($loop);

$unique = array();

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

return 
$this->end();
PHP Loops Seconds Percent
8.3.13 100.000 9.269789 +258%
8.3.10 100.000 6.640099 +185%
8.3.9 100.000 6.238676 +173%
7.3.33 100.000 4.858277 +135%
7.3.31 100.000 4.037284 +112%
7.3.30 100.000 3.966713 +110%
7.3.29 100.000 4.232592 +118%
7.3.28 100.000 3.828894 +106%
7.3.27 100.000 4.467742 +124%
7.3.24 100.000 4.311606 +120%
7.3.23 100.000 4.767254 +133%
7.3.22 100.000 4.244006 +118%
7.3.19 100.000 4.469661 +124%
7.3.18 100.000 3.952111 +110%
7.3.17 100.000 3.984500 +111%
7.3.16 100.000 4.026324 +112%
7.3.15 100.000 3.650892 +101%
7.3.14 100.000 4.145789 +115%
7.3.13 100.000 3.979310 +111%
7.3.12 100.000 3.597550 100%
7.3.11 100.000 5.383468 +150%
7.3.9 100.000 6.236336 +173%
7.3.8 100.000 6.350964 +177%
7.2.29 100.000 4.926121 +137%
8.3.13 10.000 0.092335 +246%
7.2.34 100.000 5.839913 +162%
7.2.33 100.000 5.860425 +163%
7.2.31 100.000 5.570937 +155%
7.2.30 100.000 5.247030 +146%
8.3.10 10.000 0.077458 +206%
7.2.28 100.000 4.835112 +134%
7.2.27 100.000 5.076332 +141%
7.2.26 100.000 4.946072 +137%
7.2.25 100.000 4.472987 +124%
7.2.24 100.000 6.153600 +171%
7.2.22 100.000 7.333443 +204%
7.2.21 100.000 7.131687 +198%
7.1.33 100.000 5.482992 +152%
7.1.32 100.000 7.417348 +206%
7.1.31 100.000 7.436258 +207%
7.1.0 100.000 31.701940 +881%
7.0.33 100.000 5.545586 +154%
7.0.7 100.000 30.365921 +844%
5.6.40 100.000 16.281226 +453%
5.6.22 100.000 38.763894 +1078%
5.5.36 100.000 41.438303 +1152%
5.4.45 100.000 39.377256 +1095%
5.3.29 100.000 39.838483 +1107%
8.3.9 10.000 0.073925 +197%
8.0.30 100.000 5.169169 +144%
8.0.29 100.000 4.388111 +122%
8.0.28 100.000 4.009436 +111%
8.0.27 100.000 3.985222 +111%
8.0.26 100.000 4.191600 +117%
8.0.25 100.000 4.237280 +118%
8.0.24 100.000 3.958873 +110%
8.0.23 100.000 4.214156 +117%
8.0.20 10.000 0.047426 +126%
8.0.20 100.000 4.232922 +118%
8.0.19 10.000 0.038710 +103%
8.0.19 100.000 3.645700 +101%
8.0.17 10.000 0.045003 +120%
8.0.17 100.000 4.191916 +117%
8.0.16 10.000 0.048815 +130%
8.0.16 100.000 4.553186 +127%
8.0.14 10.000 0.042048 +112%
8.0.14 100.000 4.360393 +121%
8.0.11 100.000 4.395500 +122%
8.0.10 100.000 4.106734 +114%
8.0.9 100.000 4.205660 +117%
8.0.8 100.000 4.538323 +126%
8.0.7 100.000 4.130422 +115%
8.0.3 100.000 4.421286 +123%
8.0.2 100.000 5.313302 +148%
8.0.0 100.000 4.125094 +115%
7.4.33 100.000 5.273092 +147%
7.4.32 100.000 4.377278 +122%
7.4.30 100.000 4.387965 +122%
7.4.28 100.000 4.294315 +119%
7.4.27 100.000 4.586997 +128%
7.4.24 100.000 4.383677 +122%
7.4.23 100.000 4.247688 +118%
7.4.22 100.000 4.193491 +117%
8.0.11 10.000 0.047416 +126%
8.0.10 10.000 0.048628 +130%
8.0.0 10.000 0.043493 +116%
7.4.29 100.000 4.311798 +120%
7.4.21 10.000 0.043884 +117%
7.4.21 100.000 4.162002 +116%
7.4.20 10.000 0.044258 +118%
7.4.20 100.000 4.118963 +114%
7.4.16 100.000 4.343435 +121%
7.4.15 100.000 5.288770 +147%
7.4.33 10.000 0.059460 +158%
7.4.32 10.000 0.049251 +131%
7.4.30 10.000 0.046621 +124%
7.4.29 10.000 0.048640 +130%
7.4.24 10.000 0.048981 +130%
7.4.23 10.000 0.048641 +130%
7.4.22 10.000 0.042143 +112%
7.4.13 100.000 4.367122 +121%
7.4.12 100.000 5.020468 +140%
7.4.11 100.000 4.570647 +127%
7.4.10 100.000 4.416906 +123%
8.0.2 10.000 0.069038 +184%
7.4.0 100.000 5.696365 +158%
8.0.30 10.000 0.058576 +156%
8.0.29 10.000 0.045277 +121%
8.0.28 10.000 0.041479 +110%
8.0.27 10.000 0.038699 +103%
8.0.26 10.000 0.038899 +104%
8.0.25 10.000 0.047459 +126%
8.0.24 10.000 0.045293 +121%
8.0.23 10.000 0.046347 +123%
8.0.9 10.000 0.047404 +126%
8.0.8 10.000 0.043954 +117%
8.0.7 10.000 0.048633 +130%
8.0.3 10.000 0.053184 +142%
7.4.28 10.000 0.048984 +130%
7.4.27 10.000 0.049457 +132%
7.4.16 10.000 0.054339 +145%
7.4.15 10.000 0.067860 +181%
7.4.13 10.000 0.049151 +131%
7.4.12 10.000 0.052014 +139%
7.4.11 10.000 0.046875 +125%
7.4.10 10.000 0.046444 +124%
7.4.7 10.000 0.050022 +133%
7.4.7 100.000 4.679775 +130%
7.4.6 10.000 0.045315 +121%
7.4.6 100.000 4.033090 +112%
7.4.5 10.000 0.047217 +126%
7.4.5 100.000 4.124053 +115%
7.4.4 10.000 0.043242 +115%
7.4.4 100.000 3.990032 +111%
7.4.3 10.000 0.044213 +118%
7.4.3 100.000 3.859121 +107%
7.4.1 100.000 4.044776 +112%
7.4.2 10.000 0.046224 +123%
7.4.2 100.000 4.230042 +118%
7.4.1 10.000 0.047522 +127%
7.4.0 10.000 0.062764 +167%
7.3.33 10.000 0.054294 +145%
7.3.31 10.000 0.044434 +118%
7.3.30 10.000 0.042369 +113%
7.3.29 10.000 0.047362 +126%
7.3.28 10.000 0.042787 +114%
7.3.27 10.000 0.055207 +147%
7.3.24 10.000 0.042896 +114%
7.3.23 10.000 0.050750 +135%
7.3.22 10.000 0.041565 +111%
7.3.19 10.000 0.047765 +127%
7.3.18 10.000 0.041962 +112%
7.3.17 10.000 0.039237 +105%
7.3.16 10.000 0.045789 +122%
7.3.15 10.000 0.037538 100%
7.3.14 10.000 0.046432 +124%
7.3.13 10.000 0.045413 +121%
7.3.12 10.000 0.039785 +106%
7.3.11 10.000 0.056698 +151%
7.3.9 10.000 0.068832 +183%
7.3.8 10.000 0.071198 +190%
7.2.34 10.000 0.058619 +156%
7.2.33 10.000 0.058055 +155%
7.2.31 10.000 0.057959 +154%
7.2.30 10.000 0.051867 +138%
7.2.29 10.000 0.050986 +136%
7.2.28 10.000 0.049449 +132%
7.2.27 10.000 0.054817 +146%
7.2.26 10.000 0.053070 +141%
7.2.25 10.000 0.043958 +117%
7.2.24 10.000 0.065574 +175%
7.2.22 10.000 0.078690 +210%
7.2.21 10.000 0.078891 +210%
7.1.33 10.000 0.057487 +153%
7.1.32 10.000 0.087247 +232%
7.1.31 10.000 0.084049 +224%
7.1.0 10.000 0.311503 +830%
7.0.33 10.000 0.055623 +148%
7.0.7 10.000 0.300728 +801%
5.6.40 10.000 0.091423 +244%
5.6.22 10.000 0.375665 +1001%
5.5.36 10.000 0.402973 +1073%
5.4.45 10.000 0.370287 +986%
5.3.29 10.000 0.400222 +1066%