Create a multiple if/elseif/else conditions
<?php
$this->start($loop);
for ($i = 0; $i < $this->loop; ++$i) {
if ($i === 'a') {
$value = 'a';
} elseif ($i === 'b') {
$value = 'b';
} elseif ($i === 3) {
$value = 3;
} else {
$value = $i;
}
}
return $this->end();
PHP | Loops | Seconds | Percent |
---|---|---|---|
8.3.10 | 100.000 | 0.009183 | 100% |
8.3.9 | 100.000 | 0.008811 | 100% |
7.3.33 | 100.000 | 0.005567 | 100% |
7.3.31 | 100.000 | 0.005095 | 100% |
7.3.30 | 100.000 | 0.005267 | 100% |
7.3.29 | 100.000 | 0.004850 | 100% |
7.3.28 | 100.000 | 0.005894 | 100% |
7.3.27 | 100.000 | 0.006245 | 100% |
7.3.24 | 100.000 | 0.004384 | 100% |
7.3.23 | 100.000 | 0.004325 | 100% |
7.3.22 | 100.000 | 0.004939 | 100% |
7.3.19 | 100.000 | 0.004826 | 100% |
7.3.18 | 100.000 | 0.005909 | 100% |
7.3.17 | 100.000 | 0.005317 | 100% |
7.3.16 | 100.000 | 0.004456 | 100% |
7.3.15 | 100.000 | 0.004575 | 100% |
7.3.14 | 100.000 | 0.005566 | 100% |
7.3.13 | 100.000 | 0.006748 | 100% |
7.3.12 | 100.000 | 0.005359 | 100% |
7.3.11 | 100.000 | 0.004349 | 100% |
7.3.9 | 100.000 | 0.004238 | 100% |
7.3.8 | 100.000 | 0.003964 | 100% |
7.2.30 | 100.000 | 0.005142 | 100% |
8.3.10 | 10.000 | 0.001164 | 100% |
7.2.34 | 100.000 | 0.005915 | 100% |
7.2.33 | 100.000 | 0.005426 | 100% |
7.2.31 | 100.000 | 0.005151 | 100% |
7.2.29 | 100.000 | 0.004917 | 100% |
7.2.28 | 100.000 | 0.005158 | 100% |
7.2.27 | 100.000 | 0.005572 | 100% |
7.2.26 | 100.000 | 0.006516 | 100% |
7.2.25 | 100.000 | 0.005972 | 100% |
7.2.24 | 100.000 | 0.003862 | 100% |
7.2.22 | 100.000 | 0.004215 | 100% |
7.2.21 | 100.000 | 0.003976 | 100% |
7.1.33 | 100.000 | 0.006508 | 100% |
7.1.32 | 100.000 | 0.005239 | 100% |
7.1.31 | 100.000 | 0.004683 | 100% |
7.1.0 | 100.000 | 0.029445 | 100% |
7.0.33 | 100.000 | 0.005999 | 100% |
7.0.7 | 100.000 | 0.028452 | 100% |
5.6.40 | 100.000 | 0.015325 | 100% |
5.6.22 | 100.000 | 0.061139 | 100% |
5.5.36 | 100.000 | 0.063572 | 100% |
5.4.45 | 100.000 | 0.062047 | 100% |
5.3.29 | 100.000 | 0.070469 | 100% |
8.3.9 | 10.000 | 0.001087 | 100% |
8.0.30 | 100.000 | 0.006298 | 100% |
8.0.29 | 100.000 | 0.003673 | 100% |
8.0.28 | 100.000 | 0.004197 | 100% |
8.0.27 | 100.000 | 0.005931 | 100% |
8.0.26 | 100.000 | 0.004731 | 100% |
8.0.25 | 100.000 | 0.005719 | 100% |
8.0.24 | 100.000 | 0.004842 | 100% |
8.0.23 | 100.000 | 0.005684 | 100% |
8.0.20 | 10.000 | 0.000433 | 100% |
8.0.20 | 100.000 | 0.004275 | 100% |
8.0.19 | 10.000 | 0.000627 | 100% |
8.0.19 | 100.000 | 0.005992 | 100% |
8.0.17 | 10.000 | 0.000625 | 100% |
8.0.17 | 100.000 | 0.005790 | 100% |
8.0.16 | 10.000 | 0.000513 | 100% |
8.0.16 | 100.000 | 0.005225 | 100% |
8.0.14 | 10.000 | 0.000583 | 100% |
8.0.14 | 100.000 | 0.005653 | 100% |
8.0.11 | 100.000 | 0.004841 | 100% |
8.0.10 | 100.000 | 0.005078 | 100% |
8.0.9 | 100.000 | 0.003875 | 100% |
8.0.8 | 100.000 | 0.005707 | 100% |
8.0.7 | 100.000 | 0.005397 | 100% |
8.0.3 | 100.000 | 0.006320 | 100% |
8.0.2 | 100.000 | 0.007617 | 100% |
8.0.0 | 100.000 | 0.004338 | 100% |
7.4.33 | 100.000 | 0.004924 | 100% |
7.4.32 | 100.000 | 0.004572 | 100% |
7.4.30 | 100.000 | 0.003848 | 100% |
7.4.28 | 100.000 | 0.004794 | 100% |
7.4.27 | 100.000 | 0.005124 | 100% |
7.4.24 | 100.000 | 0.004162 | 100% |
7.4.23 | 100.000 | 0.004163 | 100% |
7.4.22 | 100.000 | 0.003459 | 100% |
8.0.11 | 10.000 | 0.000526 | 100% |
8.0.10 | 10.000 | 0.000488 | 100% |
8.0.0 | 10.000 | 0.000545 | 100% |
7.4.29 | 100.000 | 0.005264 | 100% |
7.4.21 | 10.000 | 0.000490 | 100% |
7.4.21 | 100.000 | 0.004702 | 100% |
7.4.20 | 10.000 | 0.000478 | 100% |
7.4.20 | 100.000 | 0.005177 | 100% |
7.4.16 | 100.000 | 0.006003 | 100% |
7.4.15 | 100.000 | 0.007190 | 100% |
7.4.33 | 10.000 | 0.000550 | 100% |
7.4.32 | 10.000 | 0.000522 | 100% |
7.4.30 | 10.000 | 0.000419 | 100% |
7.4.29 | 10.000 | 0.000589 | 100% |
7.4.24 | 10.000 | 0.000474 | 100% |
7.4.23 | 10.000 | 0.000449 | 100% |
7.4.22 | 10.000 | 0.000374 | 100% |
7.4.13 | 100.000 | 0.004221 | 100% |
7.4.12 | 100.000 | 0.004023 | 100% |
7.4.11 | 100.000 | 0.004705 | 100% |
7.4.10 | 100.000 | 0.004507 | 100% |
8.0.2 | 10.000 | 0.000640 | 100% |
7.4.0 | 100.000 | 0.003892 | 100% |
8.0.30 | 10.000 | 0.000760 | 100% |
8.0.29 | 10.000 | 0.000354 | 100% |
8.0.28 | 10.000 | 0.000442 | 100% |
8.0.27 | 10.000 | 0.000525 | 100% |
8.0.26 | 10.000 | 0.000497 | 100% |
8.0.25 | 10.000 | 0.000639 | 100% |
8.0.24 | 10.000 | 0.000503 | 100% |
8.0.23 | 10.000 | 0.000532 | 100% |
8.0.9 | 10.000 | 0.000547 | 100% |
8.0.8 | 10.000 | 0.000643 | 100% |
8.0.7 | 10.000 | 0.000642 | 100% |
8.0.3 | 10.000 | 0.000686 | 100% |
7.4.28 | 10.000 | 0.000479 | 100% |
7.4.27 | 10.000 | 0.000505 | 100% |
7.4.16 | 10.000 | 0.000666 | 100% |
7.4.15 | 10.000 | 0.000741 | 100% |
7.4.13 | 10.000 | 0.000458 | 100% |
7.4.12 | 10.000 | 0.000535 | 100% |
7.4.11 | 10.000 | 0.000629 | 100% |
7.4.10 | 10.000 | 0.000494 | 100% |
7.4.7 | 10.000 | 0.000464 | 100% |
7.4.7 | 100.000 | 0.004428 | 100% |
7.4.6 | 10.000 | 0.000471 | 100% |
7.4.6 | 100.000 | 0.004459 | 100% |
7.4.5 | 10.000 | 0.000420 | 100% |
7.4.5 | 100.000 | 0.003771 | 100% |
7.4.4 | 10.000 | 0.000459 | 100% |
7.4.4 | 100.000 | 0.004554 | 100% |
7.4.3 | 10.000 | 0.000393 | 100% |
7.4.3 | 100.000 | 0.004605 | 100% |
7.4.1 | 100.000 | 0.006057 | 100% |
7.4.2 | 10.000 | 0.000587 | 100% |
7.4.2 | 100.000 | 0.005490 | 100% |
7.4.1 | 10.000 | 0.000592 | 100% |
7.4.0 | 10.000 | 0.000414 | 100% |
7.3.33 | 10.000 | 0.000631 | 100% |
7.3.31 | 10.000 | 0.000586 | 100% |
7.3.30 | 10.000 | 0.000534 | 100% |
7.3.29 | 10.000 | 0.000446 | 100% |
7.3.28 | 10.000 | 0.000521 | 100% |
7.3.27 | 10.000 | 0.000678 | 100% |
7.3.24 | 10.000 | 0.000457 | 100% |
7.3.23 | 10.000 | 0.000484 | 100% |
7.3.22 | 10.000 | 0.000574 | 100% |
7.3.19 | 10.000 | 0.000576 | 100% |
7.3.18 | 10.000 | 0.000542 | 100% |
7.3.17 | 10.000 | 0.000546 | 100% |
7.3.16 | 10.000 | 0.000467 | 100% |
7.3.15 | 10.000 | 0.000518 | 100% |
7.3.14 | 10.000 | 0.000622 | 100% |
7.3.13 | 10.000 | 0.000703 | 100% |
7.3.12 | 10.000 | 0.000617 | 100% |
7.3.11 | 10.000 | 0.000412 | 100% |
7.3.9 | 10.000 | 0.000435 | 100% |
7.3.8 | 10.000 | 0.000403 | 100% |
7.2.34 | 10.000 | 0.000637 | 100% |
7.2.33 | 10.000 | 0.000586 | 100% |
7.2.31 | 10.000 | 0.000563 | 100% |
7.2.30 | 10.000 | 0.000508 | 100% |
7.2.29 | 10.000 | 0.000510 | 100% |
7.2.28 | 10.000 | 0.000643 | 100% |
7.2.27 | 10.000 | 0.000650 | 100% |
7.2.26 | 10.000 | 0.000629 | 100% |
7.2.25 | 10.000 | 0.000712 | 100% |
7.2.24 | 10.000 | 0.000418 | 100% |
7.2.22 | 10.000 | 0.000493 | 100% |
7.2.21 | 10.000 | 0.000386 | 100% |
7.1.33 | 10.000 | 0.000693 | 100% |
7.1.32 | 10.000 | 0.000529 | 100% |
7.1.31 | 10.000 | 0.000455 | 100% |
7.1.0 | 10.000 | 0.003064 | 100% |
7.0.33 | 10.000 | 0.000653 | 100% |
7.0.7 | 10.000 | 0.002922 | 100% |
5.6.40 | 10.000 | 0.001770 | 100% |
5.6.22 | 10.000 | 0.006375 | 100% |
5.5.36 | 10.000 | 0.006706 | 100% |
5.4.45 | 10.000 | 0.006489 | 100% |
5.3.29 | 10.000 | 0.007343 | 100% |
Create a switch with multiple case conditions
<?php
$this->start($loop);
for ($i = 0; $i < $this->loop; ++$i) {
switch ($i) {
case 'a':
$value = 'a';
break;
case 'b':
$value = 'b';
break;
case 3:
$value = 3;
break;
default:
$value = $i;
break;
}
}
return $this->end();
PHP | Loops | Seconds | Percent |
---|---|---|---|
8.3.10 | 100.000 | 0.025646 | +279% |
8.3.9 | 100.000 | 0.026160 | +297% |
7.3.33 | 100.000 | 0.010351 | +186% |
7.3.31 | 100.000 | 0.010645 | +209% |
7.3.30 | 100.000 | 0.011258 | +214% |
7.3.29 | 100.000 | 0.009991 | +206% |
7.3.28 | 100.000 | 0.012477 | +212% |
7.3.27 | 100.000 | 0.013692 | +219% |
7.3.24 | 100.000 | 0.010177 | +232% |
7.3.23 | 100.000 | 0.009574 | +221% |
7.3.22 | 100.000 | 0.009782 | +198% |
7.3.19 | 100.000 | 0.010576 | +219% |
7.3.18 | 100.000 | 0.010277 | +174% |
7.3.17 | 100.000 | 0.010547 | +198% |
7.3.16 | 100.000 | 0.010859 | +244% |
7.3.15 | 100.000 | 0.011460 | +250% |
7.3.14 | 100.000 | 0.012866 | +231% |
7.3.13 | 100.000 | 0.013265 | +197% |
7.3.12 | 100.000 | 0.011418 | +213% |
7.3.11 | 100.000 | 0.009173 | +211% |
7.3.9 | 100.000 | 0.010395 | +245% |
7.3.8 | 100.000 | 0.009443 | +238% |
7.2.30 | 100.000 | 0.009574 | +186% |
8.3.10 | 10.000 | 0.004123 | +354% |
7.2.34 | 100.000 | 0.010363 | +175% |
7.2.33 | 100.000 | 0.009095 | +168% |
7.2.31 | 100.000 | 0.010390 | +202% |
7.2.29 | 100.000 | 0.009223 | +188% |
7.2.28 | 100.000 | 0.010414 | +202% |
7.2.27 | 100.000 | 0.012488 | +224% |
7.2.26 | 100.000 | 0.011784 | +181% |
7.2.25 | 100.000 | 0.011165 | +187% |
7.2.24 | 100.000 | 0.008202 | +212% |
7.2.22 | 100.000 | 0.010145 | +241% |
7.2.21 | 100.000 | 0.008396 | +211% |
7.1.33 | 100.000 | 0.011960 | +184% |
7.1.32 | 100.000 | 0.011203 | +214% |
7.1.31 | 100.000 | 0.009432 | +201% |
7.1.0 | 100.000 | 0.052569 | +179% |
7.0.33 | 100.000 | 0.011635 | +194% |
7.0.7 | 100.000 | 0.051678 | +182% |
5.6.40 | 100.000 | 0.021780 | +142% |
5.6.22 | 100.000 | 0.085391 | +140% |
5.5.36 | 100.000 | 0.087119 | +137% |
5.4.45 | 100.000 | 0.087553 | +141% |
5.3.29 | 100.000 | 0.095187 | +135% |
8.3.9 | 10.000 | 0.003688 | +339% |
8.0.30 | 100.000 | 0.017833 | +283% |
8.0.29 | 100.000 | 0.012971 | +353% |
8.0.28 | 100.000 | 0.013914 | +331% |
8.0.27 | 100.000 | 0.016089 | +271% |
8.0.26 | 100.000 | 0.015535 | +328% |
8.0.25 | 100.000 | 0.018204 | +318% |
8.0.24 | 100.000 | 0.017171 | +355% |
8.0.23 | 100.000 | 0.020534 | +361% |
8.0.20 | 10.000 | 0.001662 | +384% |
8.0.20 | 100.000 | 0.016018 | +375% |
8.0.19 | 10.000 | 0.001795 | +286% |
8.0.19 | 100.000 | 0.019501 | +325% |
8.0.17 | 10.000 | 0.002035 | +326% |
8.0.17 | 100.000 | 0.019339 | +334% |
8.0.16 | 10.000 | 0.001902 | +370% |
8.0.16 | 100.000 | 0.018362 | +351% |
8.0.14 | 10.000 | 0.002265 | +389% |
8.0.14 | 100.000 | 0.018303 | +324% |
8.0.11 | 100.000 | 0.017888 | +370% |
8.0.10 | 100.000 | 0.017568 | +346% |
8.0.9 | 100.000 | 0.017734 | +458% |
8.0.8 | 100.000 | 0.017961 | +315% |
8.0.7 | 100.000 | 0.018040 | +334% |
8.0.3 | 100.000 | 0.022564 | +357% |
8.0.2 | 100.000 | 0.025135 | +330% |
8.0.0 | 100.000 | 0.016981 | +391% |
7.4.33 | 100.000 | 0.009881 | +201% |
7.4.32 | 100.000 | 0.009996 | +219% |
7.4.30 | 100.000 | 0.008891 | +231% |
7.4.28 | 100.000 | 0.010743 | +224% |
7.4.27 | 100.000 | 0.010961 | +214% |
7.4.24 | 100.000 | 0.009917 | +238% |
7.4.23 | 100.000 | 0.009725 | +234% |
7.4.22 | 100.000 | 0.010133 | +293% |
8.0.11 | 10.000 | 0.001918 | +365% |
8.0.10 | 10.000 | 0.001972 | +404% |
8.0.0 | 10.000 | 0.001943 | +357% |
7.4.29 | 100.000 | 0.013127 | +249% |
7.4.21 | 10.000 | 0.001194 | +244% |
7.4.21 | 100.000 | 0.013392 | +285% |
7.4.20 | 10.000 | 0.001281 | +268% |
7.4.20 | 100.000 | 0.010855 | +210% |
7.4.16 | 100.000 | 0.014023 | +234% |
7.4.15 | 100.000 | 0.013699 | +191% |
7.4.33 | 10.000 | 0.001149 | +209% |
7.4.32 | 10.000 | 0.001056 | +202% |
7.4.30 | 10.000 | 0.000914 | +218% |
7.4.29 | 10.000 | 0.001190 | +202% |
7.4.24 | 10.000 | 0.001202 | +254% |
7.4.23 | 10.000 | 0.001126 | +251% |
7.4.22 | 10.000 | 0.001085 | +290% |
7.4.13 | 100.000 | 0.010589 | +251% |
7.4.12 | 100.000 | 0.010582 | +263% |
7.4.11 | 100.000 | 0.012363 | +263% |
7.4.10 | 100.000 | 0.009532 | +211% |
8.0.2 | 10.000 | 0.002810 | +439% |
7.4.0 | 100.000 | 0.010664 | +274% |
8.0.30 | 10.000 | 0.002129 | +280% |
8.0.29 | 10.000 | 0.001349 | +381% |
8.0.28 | 10.000 | 0.001474 | +334% |
8.0.27 | 10.000 | 0.001849 | +352% |
8.0.26 | 10.000 | 0.001605 | +323% |
8.0.25 | 10.000 | 0.001914 | +300% |
8.0.24 | 10.000 | 0.001958 | +390% |
8.0.23 | 10.000 | 0.001838 | +346% |
8.0.9 | 10.000 | 0.001583 | +289% |
8.0.8 | 10.000 | 0.002136 | +332% |
8.0.7 | 10.000 | 0.002306 | +359% |
8.0.3 | 10.000 | 0.002710 | +395% |
7.4.28 | 10.000 | 0.000971 | +203% |
7.4.27 | 10.000 | 0.001187 | +235% |
7.4.16 | 10.000 | 0.001481 | +222% |
7.4.15 | 10.000 | 0.001396 | +189% |
7.4.13 | 10.000 | 0.001149 | +251% |
7.4.12 | 10.000 | 0.000975 | +182% |
7.4.11 | 10.000 | 0.001143 | +182% |
7.4.10 | 10.000 | 0.001217 | +246% |
7.4.7 | 10.000 | 0.001013 | +218% |
7.4.7 | 100.000 | 0.010296 | +233% |
7.4.6 | 10.000 | 0.001158 | +246% |
7.4.6 | 100.000 | 0.010207 | +229% |
7.4.5 | 10.000 | 0.001009 | +241% |
7.4.5 | 100.000 | 0.011849 | +314% |
7.4.4 | 10.000 | 0.000923 | +201% |
7.4.4 | 100.000 | 0.011738 | +258% |
7.4.3 | 10.000 | 0.000936 | +238% |
7.4.3 | 100.000 | 0.012284 | +267% |
7.4.1 | 100.000 | 0.013668 | +226% |
7.4.2 | 10.000 | 0.001437 | +245% |
7.4.2 | 100.000 | 0.013307 | +242% |
7.4.1 | 10.000 | 0.001130 | +191% |
7.4.0 | 10.000 | 0.001076 | +260% |
7.3.33 | 10.000 | 0.001140 | +181% |
7.3.31 | 10.000 | 0.001194 | +204% |
7.3.30 | 10.000 | 0.001009 | +189% |
7.3.29 | 10.000 | 0.001124 | +252% |
7.3.28 | 10.000 | 0.001126 | +216% |
7.3.27 | 10.000 | 0.001371 | +202% |
7.3.24 | 10.000 | 0.001107 | +242% |
7.3.23 | 10.000 | 0.001057 | +219% |
7.3.22 | 10.000 | 0.001063 | +185% |
7.3.19 | 10.000 | 0.001174 | +204% |
7.3.18 | 10.000 | 0.000960 | +177% |
7.3.17 | 10.000 | 0.001029 | +188% |
7.3.16 | 10.000 | 0.001155 | +248% |
7.3.15 | 10.000 | 0.001236 | +239% |
7.3.14 | 10.000 | 0.001328 | +213% |
7.3.13 | 10.000 | 0.001446 | +206% |
7.3.12 | 10.000 | 0.001076 | +174% |
7.3.11 | 10.000 | 0.000918 | +223% |
7.3.9 | 10.000 | 0.000993 | +228% |
7.3.8 | 10.000 | 0.000968 | +240% |
7.2.34 | 10.000 | 0.001095 | +172% |
7.2.33 | 10.000 | 0.001025 | +175% |
7.2.31 | 10.000 | 0.001098 | +195% |
7.2.30 | 10.000 | 0.001007 | +198% |
7.2.29 | 10.000 | 0.000960 | +188% |
7.2.28 | 10.000 | 0.001129 | +175% |
7.2.27 | 10.000 | 0.001393 | +214% |
7.2.26 | 10.000 | 0.001062 | +169% |
7.2.25 | 10.000 | 0.000946 | +133% |
7.2.24 | 10.000 | 0.000816 | +195% |
7.2.22 | 10.000 | 0.000949 | +193% |
7.2.21 | 10.000 | 0.000866 | +224% |
7.1.33 | 10.000 | 0.001317 | +190% |
7.1.32 | 10.000 | 0.001164 | +220% |
7.1.31 | 10.000 | 0.000998 | +219% |
7.1.0 | 10.000 | 0.005663 | +185% |
7.0.33 | 10.000 | 0.001275 | +195% |
7.0.7 | 10.000 | 0.005400 | +185% |
5.6.40 | 10.000 | 0.002608 | +147% |
5.6.22 | 10.000 | 0.008874 | +139% |
5.5.36 | 10.000 | 0.009035 | +135% |
5.4.45 | 10.000 | 0.009289 | +143% |
5.3.29 | 10.000 | 0.009965 | +136% |