ForeachUniqueEmptyTest

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


<?php 

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

$this->start($loop);

$unique = array();

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

$unique array_keys($unique);

return 
$this->end();
PHP Loops Seconds Percent
8.0.30 10.000 0.001176 +149%
8.0.30 100.000 0.007527 +138%
8.0.9 100.000 0.006506 +119%
8.0.8 100.000 0.005946 +109%
7.3.13 100.000 0.005964 +109%
7.3.12 100.000 0.006087 +112%
7.3.11 100.000 0.006954 +128%
7.2.34 100.000 0.006703 +123%
7.2.33 100.000 0.006979 +128%
7.2.31 100.000 0.006749 +124%
7.2.30 100.000 0.006400 +117%
7.2.29 100.000 0.006300 +116%
7.2.28 100.000 0.005941 +109%
7.2.27 100.000 0.006193 +114%
7.2.26 100.000 0.006252 +115%
7.2.25 100.000 0.005686 +104%
7.2.24 100.000 0.007063 +130%
7.2.22 100.000 0.007667 +141%
7.2.21 100.000 0.007822 +143%
7.1.33 100.000 0.006473 +119%
7.1.32 100.000 0.008155 +150%
7.1.31 100.000 0.008302 +152%
7.1.0 100.000 0.037384 +685%
7.0.33 100.000 0.013597 +249%
7.0.7 100.000 0.036716 +673%
5.6.40 100.000 0.021573 +396%
5.6.22 100.000 0.096203 +1764%
5.5.36 100.000 0.104639 +1919%
5.4.45 100.000 0.091777 +1683%
5.3.29 100.000 0.227182 +4165%
8.0.29 10.000 0.000997 +126%
8.0.29 100.000 0.006316 +116%
8.0.28 100.000 0.006018 +110%
8.0.27 100.000 0.006257 +115%
8.0.26 100.000 0.006825 +125%
8.0.25 100.000 0.006435 +118%
8.0.24 100.000 0.006243 +114%
8.0.23 100.000 0.006545 +120%
8.0.20 100.000 0.006145 +113%
8.0.19 100.000 0.006237 +114%
8.0.17 100.000 0.006667 +122%
8.0.16 100.000 0.007758 +142%
8.0.14 100.000 0.006518 +120%
8.0.11 10.000 0.001294 +164%
8.0.11 100.000 0.006828 +125%
8.0.10 10.000 0.001292 +163%
8.0.10 100.000 0.007034 +129%
7.3.15 100.000 0.005942 +109%
8.0.28 10.000 0.000980 +124%
8.0.27 10.000 0.001214 +154%
8.0.26 10.000 0.001151 +145%
8.0.25 10.000 0.001115 +141%
8.0.24 10.000 0.001147 +145%
8.0.23 10.000 0.001131 +143%
8.0.20 10.000 0.001008 +127%
8.0.19 10.000 0.001370 +173%
8.0.17 10.000 0.001198 +151%
8.0.16 10.000 0.001375 +174%
8.0.14 10.000 0.001356 +171%
7.3.14 100.000 0.006223 +114%
8.0.9 10.000 0.001387 +175%
8.0.7 100.000 0.006947 +127%
8.0.8 10.000 0.001523 +193%
8.0.3 100.000 0.008039 +147%
8.0.2 100.000 0.009409 +173%
8.0.0 100.000 0.006755 +124%
7.4.33 100.000 0.006418 +118%
8.0.7 10.000 0.001375 +174%
7.4.32 100.000 0.005874 +108%
7.4.30 100.000 0.006199 +114%
7.4.29 100.000 0.005743 +105%
7.4.27 100.000 0.006298 +115%
8.0.3 10.000 0.001656 +209%
7.4.28 100.000 0.006411 +118%
7.4.24 100.000 0.006195 +114%
7.4.7 100.000 0.006614 +121%
7.4.6 100.000 0.005913 +108%
7.4.5 100.000 0.005883 +108%
7.4.4 100.000 0.005827 +107%
8.0.2 10.000 0.001828 +231%
8.0.0 10.000 0.001426 +180%
7.4.3 100.000 0.005840 +107%
7.4.33 10.000 0.001145 +145%
7.4.32 10.000 0.001213 +153%
7.4.30 10.000 0.001022 +129%
7.4.29 10.000 0.001330 +168%
7.3.17 100.000 0.006597 +121%
7.3.16 100.000 0.005953 +109%
7.4.28 10.000 0.001558 +197%
7.4.23 100.000 0.006580 +121%
7.4.21 100.000 0.005454 100%
7.4.20 100.000 0.005820 +107%
7.4.24 10.000 0.001362 +172%
7.4.16 100.000 0.007072 +130%
7.4.15 10.000 0.001772 +224%
7.4.15 100.000 0.009445 +173%
7.4.13 100.000 0.006269 +115%
7.4.27 10.000 0.001551 +196%
7.4.23 10.000 0.001282 +162%
7.4.22 10.000 0.001133 +143%
7.4.22 100.000 0.006439 +118%
7.4.21 10.000 0.001639 +207%
7.4.20 10.000 0.001482 +187%
7.4.16 10.000 0.001641 +207%
7.4.13 10.000 0.001317 +166%
7.4.12 10.000 0.001338 +169%
7.4.12 100.000 0.007171 +131%
7.4.11 100.000 0.006308 +116%
7.4.11 10.000 0.001424 +180%
7.4.10 10.000 0.001435 +181%
7.4.10 100.000 0.006138 +113%
7.4.7 10.000 0.001515 +192%
7.4.6 10.000 0.001343 +170%
7.4.5 10.000 0.001337 +169%
7.4.4 10.000 0.001278 +162%
7.4.2 10.000 0.001656 +209%
7.4.2 100.000 0.006468 +119%
7.4.3 10.000 0.001261 +159%
7.4.1 10.000 0.001530 +193%
7.4.1 100.000 0.005972 +109%
7.4.0 100.000 0.006700 +123%
7.3.33 100.000 0.006564 +120%
7.3.31 100.000 0.005873 +108%
7.3.18 100.000 0.006043 +111%
7.3.33 10.000 0.001232 +156%
7.3.30 100.000 0.005929 +109%
7.4.0 10.000 0.000975 +123%
7.3.31 10.000 0.001305 +165%
7.3.29 10.000 0.001310 +166%
7.3.29 100.000 0.005991 +110%
7.3.28 10.000 0.001354 +171%
7.3.28 100.000 0.006307 +116%
7.3.27 10.000 0.001655 +209%
7.3.27 100.000 0.007489 +137%
7.3.30 10.000 0.001241 +157%
7.3.24 10.000 0.001362 +172%
7.3.24 100.000 0.006434 +118%
7.3.23 10.000 0.001435 +181%
7.3.23 100.000 0.006511 +119%
7.3.22 10.000 0.001374 +174%
7.3.22 100.000 0.006238 +114%
7.3.19 10.000 0.001607 +203%
7.3.19 100.000 0.006908 +127%
7.3.18 10.000 0.001368 +173%
7.3.17 10.000 0.001530 +193%
7.3.9 10.000 0.000949 +120%
7.3.9 100.000 0.007202 +132%
7.3.8 10.000 0.000847 +107%
7.3.8 100.000 0.007647 +140%
7.3.16 10.000 0.001340 +169%
7.3.15 10.000 0.001334 +169%
7.3.14 10.000 0.001568 +198%
7.3.13 10.000 0.001504 +190%
7.3.12 10.000 0.001442 +182%
7.3.11 10.000 0.001023 +129%
7.2.34 10.000 0.001269 +160%
7.2.33 10.000 0.001513 +191%
7.2.31 10.000 0.001388 +175%
7.2.30 10.000 0.001550 +196%
7.2.29 10.000 0.001317 +167%
7.2.28 10.000 0.001279 +162%
7.2.27 10.000 0.001457 +184%
7.2.26 10.000 0.001429 +181%
7.2.25 10.000 0.001249 +158%
7.2.24 10.000 0.000855 +108%
7.2.22 10.000 0.000942 +119%
7.2.21 10.000 0.000791 100%
7.1.33 10.000 0.001242 +157%
7.1.32 10.000 0.000913 +115%
7.1.31 10.000 0.000863 +109%
7.1.0 10.000 0.004138 +523%
7.0.33 10.000 0.001268 +160%
7.0.7 10.000 0.004286 +542%
5.6.40 10.000 0.002420 +306%
5.6.22 10.000 0.010022 +1267%
5.5.36 10.000 0.010871 +1374%
5.4.45 10.000 0.009776 +1236%
5.3.29 10.000 0.021484 +2716%