Create an array without duplicates from a range using array_unique
<?php
$values = $this->getRangeStrings($loop);
$this->start($loop);
$values = array_unique($values);
return $this->end();
PHP | Loops | Seconds | Percent |
---|---|---|---|
8.3.13 | 100.000 | 0.008417 | 100% |
8.3.10 | 100.000 | 0.007591 | 100% |
8.3.9 | 100.000 | 0.007552 | 100% |
7.3.33 | 100.000 | 0.006210 | 100% |
7.3.31 | 100.000 | 0.005439 | 100% |
7.3.30 | 100.000 | 0.005529 | 100% |
7.3.29 | 100.000 | 0.005820 | 100% |
7.3.28 | 100.000 | 0.005438 | 100% |
7.3.27 | 100.000 | 0.007032 | 100% |
7.3.24 | 100.000 | 0.006108 | 100% |
7.3.23 | 100.000 | 0.006588 | 100% |
7.3.22 | 100.000 | 0.006076 | 100% |
7.3.19 | 100.000 | 0.006263 | 100% |
7.3.18 | 100.000 | 0.005857 | 100% |
7.3.17 | 100.000 | 0.006060 | 100% |
7.3.16 | 100.000 | 0.005378 | 100% |
7.3.15 | 100.000 | 0.005650 | 100% |
7.3.14 | 100.000 | 0.005822 | 100% |
7.3.13 | 100.000 | 0.005256 | 100% |
7.3.12 | 100.000 | 0.005405 | 100% |
7.3.11 | 100.000 | 0.005704 | 100% |
7.3.9 | 100.000 | 0.006435 | 100% |
7.3.8 | 100.000 | 0.006593 | 100% |
7.2.29 | 100.000 | 0.006152 | 100% |
8.3.13 | 10.000 | 0.000920 | 100% |
7.2.34 | 100.000 | 0.005695 | 100% |
7.2.33 | 100.000 | 0.005890 | 100% |
7.2.31 | 100.000 | 0.005939 | 100% |
7.2.30 | 100.000 | 0.006161 | 100% |
8.3.10 | 10.000 | 0.001019 | 100% |
7.2.28 | 100.000 | 0.005008 | 100% |
7.2.27 | 100.000 | 0.005258 | 100% |
7.2.26 | 100.000 | 0.005149 | 100% |
7.2.25 | 100.000 | 0.004705 | 100% |
7.2.24 | 100.000 | 0.005450 | 100% |
7.2.22 | 100.000 | 0.006010 | 100% |
7.2.21 | 100.000 | 0.006164 | 100% |
7.1.33 | 100.000 | 0.041942 | 100% |
7.1.32 | 100.000 | 0.047322 | 100% |
7.1.31 | 100.000 | 0.041533 | 100% |
7.1.0 | 100.000 | 0.138957 | 100% |
7.0.33 | 100.000 | 0.050649 | 100% |
7.0.7 | 100.000 | 0.129645 | 100% |
5.6.40 | 100.000 | 0.104541 | 100% |
5.6.22 | 100.000 | 0.286389 | 100% |
5.5.36 | 100.000 | 0.284540 | 100% |
5.4.45 | 100.000 | 0.279992 | 100% |
5.3.29 | 100.000 | 0.306307 | 100% |
8.3.9 | 10.000 | 0.000701 | 100% |
8.0.30 | 100.000 | 0.006592 | 100% |
8.0.29 | 100.000 | 0.005174 | 100% |
8.0.28 | 100.000 | 0.005323 | 100% |
8.0.27 | 100.000 | 0.005611 | 100% |
8.0.26 | 100.000 | 0.005568 | 100% |
8.0.25 | 100.000 | 0.005540 | 100% |
8.0.24 | 100.000 | 0.005117 | 100% |
8.0.23 | 100.000 | 0.005036 | 100% |
8.0.20 | 10.000 | 0.000478 | 100% |
8.0.20 | 100.000 | 0.005121 | 100% |
8.0.19 | 10.000 | 0.000778 | 100% |
8.0.19 | 100.000 | 0.005369 | 100% |
8.0.17 | 10.000 | 0.000760 | 100% |
8.0.17 | 100.000 | 0.005726 | 100% |
8.0.16 | 10.000 | 0.000743 | 100% |
8.0.16 | 100.000 | 0.005449 | 100% |
8.0.14 | 10.000 | 0.000749 | 100% |
8.0.14 | 100.000 | 0.005679 | 100% |
8.0.11 | 100.000 | 0.005601 | 100% |
8.0.10 | 100.000 | 0.005532 | 100% |
8.0.9 | 100.000 | 0.005253 | 100% |
8.0.8 | 100.000 | 0.005374 | 100% |
8.0.7 | 100.000 | 0.005202 | 100% |
8.0.3 | 100.000 | 0.006271 | 100% |
8.0.2 | 100.000 | 0.008194 | 100% |
8.0.0 | 100.000 | 0.005339 | 100% |
7.4.33 | 100.000 | 0.006148 | 100% |
7.4.32 | 100.000 | 0.005253 | 100% |
7.4.30 | 100.000 | 0.005272 | 100% |
7.4.28 | 100.000 | 0.005940 | 100% |
7.4.27 | 100.000 | 0.005647 | 100% |
7.4.24 | 100.000 | 0.005569 | 100% |
7.4.23 | 100.000 | 0.005290 | 100% |
7.4.22 | 100.000 | 0.005514 | 100% |
8.0.11 | 10.000 | 0.000767 | 100% |
8.0.10 | 10.000 | 0.000679 | 100% |
8.0.0 | 10.000 | 0.000658 | 100% |
7.4.29 | 100.000 | 0.005271 | 100% |
7.4.21 | 10.000 | 0.000730 | 100% |
7.4.21 | 100.000 | 0.005124 | 100% |
7.4.20 | 10.000 | 0.000788 | 100% |
7.4.20 | 100.000 | 0.006407 | 100% |
7.4.16 | 100.000 | 0.006352 | 100% |
7.4.15 | 100.000 | 0.007998 | 100% |
7.4.33 | 10.000 | 0.000688 | 100% |
7.4.32 | 10.000 | 0.000670 | 100% |
7.4.30 | 10.000 | 0.000588 | 100% |
7.4.29 | 10.000 | 0.000791 | 100% |
7.4.24 | 10.000 | 0.000775 | 100% |
7.4.23 | 10.000 | 0.000716 | 100% |
7.4.22 | 10.000 | 0.000754 | 100% |
7.4.13 | 100.000 | 0.005400 | 100% |
7.4.12 | 100.000 | 0.006301 | 100% |
7.4.11 | 100.000 | 0.005801 | 100% |
7.4.10 | 100.000 | 0.005557 | 100% |
8.0.2 | 10.000 | 0.000987 | 100% |
7.4.0 | 100.000 | 0.006059 | 100% |
8.0.30 | 10.000 | 0.000801 | 100% |
8.0.29 | 10.000 | 0.000465 | 100% |
8.0.28 | 10.000 | 0.000598 | 100% |
8.0.27 | 10.000 | 0.000642 | 100% |
8.0.26 | 10.000 | 0.000581 | 100% |
8.0.25 | 10.000 | 0.000596 | 100% |
8.0.24 | 10.000 | 0.000518 | 100% |
8.0.23 | 10.000 | 0.000578 | 100% |
8.0.9 | 10.000 | 0.000626 | 100% |
8.0.8 | 10.000 | 0.000694 | 100% |
8.0.7 | 10.000 | 0.000714 | 100% |
8.0.3 | 10.000 | 0.000866 | 100% |
7.4.28 | 10.000 | 0.000750 | 100% |
7.4.27 | 10.000 | 0.000802 | 100% |
7.4.16 | 10.000 | 0.000866 | 100% |
7.4.15 | 10.000 | 0.000989 | 100% |
7.4.13 | 10.000 | 0.000678 | 100% |
7.4.12 | 10.000 | 0.000717 | 100% |
7.4.11 | 10.000 | 0.000706 | 100% |
7.4.10 | 10.000 | 0.000766 | 100% |
7.4.7 | 10.000 | 0.000737 | 100% |
7.4.7 | 100.000 | 0.005851 | 100% |
7.4.6 | 10.000 | 0.000723 | 100% |
7.4.6 | 100.000 | 0.005356 | 100% |
7.4.5 | 10.000 | 0.000726 | 100% |
7.4.5 | 100.000 | 0.005579 | 100% |
7.4.4 | 10.000 | 0.000758 | 100% |
7.4.4 | 100.000 | 0.006716 | 100% |
7.4.3 | 10.000 | 0.000643 | 100% |
7.4.3 | 100.000 | 0.005291 | 100% |
7.4.1 | 100.000 | 0.005186 | 100% |
7.4.2 | 10.000 | 0.000850 | 100% |
7.4.2 | 100.000 | 0.005424 | 100% |
7.4.1 | 10.000 | 0.000773 | 100% |
7.4.0 | 10.000 | 0.000637 | 100% |
7.3.33 | 10.000 | 0.000734 | 100% |
7.3.31 | 10.000 | 0.000730 | 100% |
7.3.30 | 10.000 | 0.000692 | 100% |
7.3.29 | 10.000 | 0.000812 | 100% |
7.3.28 | 10.000 | 0.000742 | 100% |
7.3.27 | 10.000 | 0.000945 | 100% |
7.3.24 | 10.000 | 0.000671 | 100% |
7.3.23 | 10.000 | 0.000851 | 100% |
7.3.22 | 10.000 | 0.000771 | 100% |
7.3.19 | 10.000 | 0.000710 | 100% |
7.3.18 | 10.000 | 0.000769 | 100% |
7.3.17 | 10.000 | 0.000785 | 100% |
7.3.16 | 10.000 | 0.000769 | 100% |
7.3.15 | 10.000 | 0.000668 | 100% |
7.3.14 | 10.000 | 0.000970 | 100% |
7.3.13 | 10.000 | 0.000828 | 100% |
7.3.12 | 10.000 | 0.000673 | 100% |
7.3.11 | 10.000 | 0.000600 | 100% |
7.3.9 | 10.000 | 0.000659 | 100% |
7.3.8 | 10.000 | 0.000615 | 100% |
7.2.34 | 10.000 | 0.000707 | 100% |
7.2.33 | 10.000 | 0.000694 | 100% |
7.2.31 | 10.000 | 0.000851 | 100% |
7.2.30 | 10.000 | 0.001054 | 100% |
7.2.29 | 10.000 | 0.000642 | 100% |
7.2.28 | 10.000 | 0.000694 | 100% |
7.2.27 | 10.000 | 0.000832 | 100% |
7.2.26 | 10.000 | 0.000791 | 100% |
7.2.25 | 10.000 | 0.000689 | 100% |
7.2.24 | 10.000 | 0.000605 | 100% |
7.2.22 | 10.000 | 0.000628 | 100% |
7.2.21 | 10.000 | 0.000596 | 100% |
7.1.33 | 10.000 | 0.003809 | 100% |
7.1.32 | 10.000 | 0.003046 | 100% |
7.1.31 | 10.000 | 0.003130 | 100% |
7.1.0 | 10.000 | 0.010543 | 100% |
7.0.33 | 10.000 | 0.003474 | 100% |
7.0.7 | 10.000 | 0.010164 | 100% |
5.6.40 | 10.000 | 0.008641 | 100% |
5.6.22 | 10.000 | 0.023247 | 100% |
5.5.36 | 10.000 | 0.023210 | 100% |
5.4.45 | 10.000 | 0.022194 | 100% |
5.3.29 | 10.000 | 0.024987 | 100% |
Create an array without duplicates from a range using foreach, checking existing with in_array and keys as values
<?php
$values = $this->getRangeStrings($loop);
$this->start($loop);
$unique = array();
foreach ($values as $value) {
if (!in_array($value, $unique)) {
$unique[] = $value;
}
}
return $this->end();
PHP | Loops | Seconds | Percent |
---|---|---|---|
8.3.13 | 100.000 | 4.574754 | +54354% |
8.3.10 | 100.000 | 3.984533 | +52488% |
8.3.9 | 100.000 | 3.730549 | +49395% |
7.3.33 | 100.000 | 2.943048 | +47394% |
7.3.31 | 100.000 | 2.510981 | +46164% |
7.3.30 | 100.000 | 2.487157 | +44984% |
7.3.29 | 100.000 | 2.517940 | +43266% |
7.3.28 | 100.000 | 2.747878 | +50535% |
7.3.27 | 100.000 | 3.051315 | +43395% |
7.3.24 | 100.000 | 2.920956 | +47819% |
7.3.23 | 100.000 | 3.171803 | +48147% |
7.3.22 | 100.000 | 2.653903 | +43682% |
7.3.19 | 100.000 | 3.106946 | +49609% |
7.3.18 | 100.000 | 2.812209 | +48012% |
7.3.17 | 100.000 | 2.671886 | +44092% |
7.3.16 | 100.000 | 2.840029 | +52808% |
7.3.15 | 100.000 | 2.337001 | +41365% |
7.3.14 | 100.000 | 2.628391 | +45148% |
7.3.13 | 100.000 | 2.683845 | +51060% |
7.3.12 | 100.000 | 2.201023 | +40722% |
7.3.11 | 100.000 | 3.942755 | +69126% |
7.3.9 | 100.000 | 5.112483 | +79448% |
7.3.8 | 100.000 | 4.946211 | +75022% |
7.2.29 | 100.000 | 3.477899 | +56537% |
8.3.13 | 10.000 | 0.055283 | +6010% |
7.2.34 | 100.000 | 4.174442 | +73297% |
7.2.33 | 100.000 | 3.931031 | +66742% |
7.2.31 | 100.000 | 3.818546 | +64300% |
7.2.30 | 100.000 | 3.754172 | +60934% |
8.3.10 | 10.000 | 0.044313 | +4350% |
7.2.28 | 100.000 | 3.336568 | +66624% |
7.2.27 | 100.000 | 3.518747 | +66923% |
7.2.26 | 100.000 | 3.332493 | +64726% |
7.2.25 | 100.000 | 3.141957 | +66778% |
7.2.24 | 100.000 | 4.881359 | +89560% |
7.2.22 | 100.000 | 6.123695 | +101896% |
7.2.21 | 100.000 | 6.037400 | +97941% |
7.1.33 | 100.000 | 4.039481 | +9631% |
7.1.32 | 100.000 | 6.263284 | +13236% |
7.1.31 | 100.000 | 6.108082 | +14707% |
7.1.0 | 100.000 | 19.108908 | +13752% |
7.0.33 | 100.000 | 4.147617 | +8189% |
7.0.7 | 100.000 | 18.538888 | +14300% |
5.6.40 | 100.000 | 28.821240 | +27569% |
5.6.22 | 100.000 | 79.505506 | +27761% |
5.5.36 | 100.000 | 82.791771 | +29097% |
5.4.45 | 100.000 | 77.334825 | +27620% |
5.3.29 | 100.000 | 72.680816 | +23728% |
8.3.9 | 10.000 | 0.041018 | +5849% |
8.0.30 | 100.000 | 3.493155 | +52991% |
8.0.29 | 100.000 | 3.021602 | +58403% |
8.0.28 | 100.000 | 2.870065 | +53923% |
8.0.27 | 100.000 | 3.187656 | +56815% |
8.0.26 | 100.000 | 3.306859 | +59391% |
8.0.25 | 100.000 | 3.247885 | +58626% |
8.0.24 | 100.000 | 3.214957 | +62825% |
8.0.23 | 100.000 | 3.317165 | +65874% |
8.0.20 | 10.000 | 0.037924 | +7940% |
8.0.20 | 100.000 | 3.331289 | +65054% |
8.0.19 | 10.000 | 0.037630 | +4840% |
8.0.19 | 100.000 | 2.898370 | +53988% |
8.0.17 | 10.000 | 0.034329 | +4517% |
8.0.17 | 100.000 | 2.892494 | +50518% |
8.0.16 | 10.000 | 0.034645 | +4666% |
8.0.16 | 100.000 | 2.991825 | +54905% |
8.0.14 | 10.000 | 0.029187 | +3898% |
8.0.14 | 100.000 | 2.705744 | +47648% |
8.0.11 | 100.000 | 2.894771 | +51680% |
8.0.10 | 100.000 | 2.407780 | +43527% |
8.0.9 | 100.000 | 2.732731 | +52019% |
8.0.8 | 100.000 | 2.778597 | +51701% |
8.0.7 | 100.000 | 2.706058 | +52020% |
8.0.3 | 100.000 | 3.044475 | +48548% |
8.0.2 | 100.000 | 3.526083 | +43031% |
8.0.0 | 100.000 | 2.585317 | +48422% |
7.4.33 | 100.000 | 3.026360 | +49224% |
7.4.32 | 100.000 | 3.125732 | +59503% |
7.4.30 | 100.000 | 3.509076 | +66555% |
7.4.28 | 100.000 | 2.856638 | +48095% |
7.4.27 | 100.000 | 2.996438 | +53062% |
7.4.24 | 100.000 | 2.463503 | +44239% |
7.4.23 | 100.000 | 2.492321 | +47115% |
7.4.22 | 100.000 | 2.794534 | +50683% |
8.0.11 | 10.000 | 0.035525 | +4635% |
8.0.10 | 10.000 | 0.031052 | +4576% |
8.0.0 | 10.000 | 0.029088 | +4423% |
7.4.29 | 100.000 | 3.568570 | +67704% |
7.4.21 | 10.000 | 0.034391 | +4711% |
7.4.21 | 100.000 | 2.551373 | +49790% |
7.4.20 | 10.000 | 0.032609 | +4138% |
7.4.20 | 100.000 | 2.443411 | +38137% |
7.4.16 | 100.000 | 3.044103 | +47922% |
7.4.15 | 100.000 | 3.483400 | +43551% |
7.4.33 | 10.000 | 0.032811 | +4767% |
7.4.32 | 10.000 | 0.036848 | +5502% |
7.4.30 | 10.000 | 0.040151 | +6830% |
7.4.29 | 10.000 | 0.044078 | +5574% |
7.4.24 | 10.000 | 0.030036 | +3875% |
7.4.23 | 10.000 | 0.032039 | +4473% |
7.4.22 | 10.000 | 0.033415 | +4432% |
7.4.13 | 100.000 | 2.741903 | +50778% |
7.4.12 | 100.000 | 2.965387 | +47061% |
7.4.11 | 100.000 | 3.125079 | +53867% |
7.4.10 | 100.000 | 2.933453 | +52792% |
8.0.2 | 10.000 | 0.042294 | +4285% |
7.4.0 | 100.000 | 4.402097 | +72655% |
8.0.30 | 10.000 | 0.039255 | +4900% |
8.0.29 | 10.000 | 0.034358 | +7383% |
8.0.28 | 10.000 | 0.032390 | +5415% |
8.0.27 | 10.000 | 0.035693 | +5559% |
8.0.26 | 10.000 | 0.035799 | +6165% |
8.0.25 | 10.000 | 0.038033 | +6380% |
8.0.24 | 10.000 | 0.037675 | +7276% |
8.0.23 | 10.000 | 0.037038 | +6408% |
8.0.9 | 10.000 | 0.034046 | +5438% |
8.0.8 | 10.000 | 0.033142 | +4773% |
8.0.7 | 10.000 | 0.035532 | +4978% |
8.0.3 | 10.000 | 0.040409 | +4666% |
7.4.28 | 10.000 | 0.035240 | +4696% |
7.4.27 | 10.000 | 0.034512 | +4304% |
7.4.16 | 10.000 | 0.040714 | +4703% |
7.4.15 | 10.000 | 0.045676 | +4619% |
7.4.13 | 10.000 | 0.030905 | +4557% |
7.4.12 | 10.000 | 0.030427 | +4246% |
7.4.11 | 10.000 | 0.037124 | +5257% |
7.4.10 | 10.000 | 0.033147 | +4326% |
7.4.7 | 10.000 | 0.030257 | +4107% |
7.4.7 | 100.000 | 2.776209 | +47451% |
7.4.6 | 10.000 | 0.035002 | +4838% |
7.4.6 | 100.000 | 2.807946 | +52430% |
7.4.5 | 10.000 | 0.034197 | +4712% |
7.4.5 | 100.000 | 2.874791 | +51530% |
7.4.4 | 10.000 | 0.031988 | +4222% |
7.4.4 | 100.000 | 2.777948 | +41362% |
7.4.3 | 10.000 | 0.035805 | +5572% |
7.4.3 | 100.000 | 2.766638 | +52287% |
7.4.1 | 100.000 | 2.500698 | +48217% |
7.4.2 | 10.000 | 0.035789 | +4208% |
7.4.2 | 100.000 | 2.947368 | +54341% |
7.4.1 | 10.000 | 0.033690 | +4360% |
7.4.0 | 10.000 | 0.049508 | +7774% |
7.3.33 | 10.000 | 0.033270 | +4534% |
7.3.31 | 10.000 | 0.030672 | +4201% |
7.3.30 | 10.000 | 0.031784 | +4595% |
7.3.29 | 10.000 | 0.030713 | +3780% |
7.3.28 | 10.000 | 0.034349 | +4627% |
7.3.27 | 10.000 | 0.039245 | +4151% |
7.3.24 | 10.000 | 0.033515 | +4992% |
7.3.23 | 10.000 | 0.034895 | +4100% |
7.3.22 | 10.000 | 0.026962 | +3496% |
7.3.19 | 10.000 | 0.035362 | +4981% |
7.3.18 | 10.000 | 0.034127 | +4437% |
7.3.17 | 10.000 | 0.030096 | +3832% |
7.3.16 | 10.000 | 0.034342 | +4468% |
7.3.15 | 10.000 | 0.027326 | +4093% |
7.3.14 | 10.000 | 0.033396 | +3444% |
7.3.13 | 10.000 | 0.034498 | +4167% |
7.3.12 | 10.000 | 0.026635 | +3959% |
7.3.11 | 10.000 | 0.042629 | +7105% |
7.3.9 | 10.000 | 0.055932 | +8481% |
7.3.8 | 10.000 | 0.054684 | +8894% |
7.2.34 | 10.000 | 0.041070 | +5813% |
7.2.33 | 10.000 | 0.039677 | +5714% |
7.2.31 | 10.000 | 0.038273 | +4499% |
7.2.30 | 10.000 | 0.038116 | +3616% |
7.2.29 | 10.000 | 0.036278 | +5647% |
7.2.28 | 10.000 | 0.038556 | +5558% |
7.2.27 | 10.000 | 0.037934 | +4561% |
7.2.26 | 10.000 | 0.037596 | +4752% |
7.2.25 | 10.000 | 0.033712 | +4893% |
7.2.24 | 10.000 | 0.046341 | +7662% |
7.2.22 | 10.000 | 0.058718 | +9343% |
7.2.21 | 10.000 | 0.058505 | +9816% |
7.1.33 | 10.000 | 0.040175 | +1055% |
7.1.32 | 10.000 | 0.060032 | +1971% |
7.1.31 | 10.000 | 0.060258 | +1925% |
7.1.0 | 10.000 | 0.185585 | +1760% |
7.0.33 | 10.000 | 0.039446 | +1135% |
7.0.7 | 10.000 | 0.179088 | +1762% |
5.6.40 | 10.000 | 0.170580 | +1974% |
5.6.22 | 10.000 | 0.686117 | +2951% |
5.5.36 | 10.000 | 0.716231 | +3086% |
5.4.45 | 10.000 | 0.660133 | +2974% |
5.3.29 | 10.000 | 0.636841 | +2549% |