3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s = ''; for ($i = 0; $i < 100000; ++$i) { // 10 MB $s .= rand(0, 9); } $s .= $s . $s . $s . $s . $s . $s . $s . $s . $s; // 100Mb echo "data: " . mb_strlen($s) / (1024 * 1024) . " Mb"; $start = microtime(true); for ($i = 0; $i < 1000; ++$i) { mb_strlen($s); } $end = microtime(true); echo "result = " . ($end - $start);
Output for 4.3.0 - 4.3.2, 5.6.7 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
data: 0.95367431640625 Mb
Process exited with code 137.
Output for 5.5.35
data: 0.95367431640625 Mbresult = 0.00012493133544922
Output for 5.5.34
data: 0.95367431640625 Mbresult = 9.8943710327148E-5
Output for 5.5.33
data: 0.95367431640625 Mbresult = 0.00010204315185547
Output for 5.5.32
data: 0.95367431640625 Mbresult = 0.00012683868408203
Output for 5.5.31
data: 0.95367431640625 Mbresult = 0.00014710426330566
Output for 5.5.30
data: 0.95367431640625 Mbresult = 0.00013208389282227
Output for 5.5.29
data: 0.95367431640625 Mbresult = 0.00015902519226074
Output for 5.5.28
data: 0.95367431640625 Mbresult = 0.00014901161193848
Output for 5.5.27
data: 0.95367431640625 Mbresult = 0.00014996528625488
Output for 5.5.25 - 5.5.26
data: 0.95367431640625 Mbresult = 0.00014090538024902
Output for 5.5.24
data: 0.95367431640625 Mbresult = 0.00011706352233887
Output for 5.4.45
data: 0.95367431640625 Mbresult = 0.00024080276489258
Output for 5.4.44
data: 0.95367431640625 Mbresult = 0.00016498565673828
Output for 5.4.43
data: 0.95367431640625 Mbresult = 0.00016999244689941
Output for 5.4.42
data: 0.95367431640625 Mbresult = 0.00022006034851074
Output for 5.4.41
data: 0.95367431640625 Mbresult = 0.00018906593322754
Output for 5.4.40
data: 0.95367431640625 Mbresult = 0.00016903877258301
Output for 5.4.39
data: 0.95367431640625 Mbresult = 0.00020003318786621
Output for 5.4.38
data: 0.95367431640625 Mbresult = 0.00017404556274414
Output for 5.3.1, 5.4.37
data: 0.95367431640625 Mbresult = 0.00017499923706055
Output for 5.4.36
data: 0.95367431640625 Mbresult = 0.00019097328186035
Output for 5.4.35
data: 0.95367431640625 Mbresult = 0.00013899803161621
Output for 5.4.34
data: 0.95367431640625 Mbresult = 0.00023579597473145
Output for 5.4.32
data: 0.95367431640625 Mbresult = 0.00021505355834961
Output for 5.4.31
data: 0.95367431640625 Mbresult = 0.0001528263092041
Output for 5.4.30
data: 0.95367431640625 Mbresult = 0.00020098686218262
Output for 5.4.29
data: 0.95367431640625 Mbresult = 0.00015997886657715
Output for 5.4.28
data: 0.95367431640625 Mbresult = 0.00034189224243164
Output for 5.4.27
data: 0.95367431640625 Mbresult = 0.0019450187683105
Output for 5.3.29, 5.4.26
data: 0.95367431640625 Mbresult = 0.00026702880859375
Output for 5.2.1, 5.4.24 - 5.4.25
data: 0.95367431640625 Mbresult = 0.00028896331787109
Output for 5.3.19, 5.4.23
data: 0.95367431640625 Mbresult = 0.00027608871459961
Output for 5.4.22
data: 0.95367431640625 Mbresult = 0.00021815299987793
Output for 5.3.25, 5.4.15, 5.4.21
data: 0.95367431640625 Mbresult = 0.00026798248291016
Output for 5.4.20
data: 0.95367431640625 Mbresult = 0.00016283988952637
Output for 5.3.4, 5.4.19
data: 0.95367431640625 Mbresult = 0.00028800964355469
Output for 5.4.18
data: 0.95367431640625 Mbresult = 0.00027585029602051
Output for 5.2.14, 5.4.17
data: 0.95367431640625 Mbresult = 0.00025200843811035
Output for 5.4.16
data: 0.95367431640625 Mbresult = 0.0013458728790283
Output for 5.4.14
data: 0.95367431640625 Mbresult = 0.00026202201843262
Output for 5.4.13
data: 0.95367431640625 Mbresult = 0.00028681755065918
Output for 5.4.12
data: 0.95367431640625 Mbresult = 0.00029206275939941
Output for 5.4.11
data: 0.95367431640625 Mbresult = 0.00020885467529297
Output for 5.4.10
data: 0.95367431640625 Mbresult = 0.00028491020202637
Output for 5.4.4, 5.4.9
data: 0.95367431640625 Mbresult = 0.00027203559875488
Output for 5.3.3, 5.3.15, 5.3.28, 5.4.8
data: 0.95367431640625 Mbresult = 0.00028610229492188
Output for 5.4.7
data: 0.95367431640625 Mbresult = 0.00031018257141113
Output for 5.4.6
data: 0.95367431640625 Mbresult = 0.00025105476379395
Output for 5.4.5
data: 0.95367431640625 Mbresult = 0.00024104118347168
Output for 5.3.7, 5.4.3
data: 0.95367431640625 Mbresult = 0.0002741813659668
Output for 5.4.2
data: 0.95367431640625 Mbresult = 0.00028204917907715
Output for 5.4.1
data: 0.95367431640625 Mbresult = 0.00029706954956055
Output for 5.3.16, 5.4.0
data: 0.95367431640625 Mbresult = 0.00030899047851562
Output for 5.3.27
data: 0.95367431640625 Mbresult = 0.00030303001403809
Output for 5.3.26
data: 0.95367431640625 Mbresult = 0.00028181076049805
Output for 5.3.24
data: 0.95367431640625 Mbresult = 0.00033402442932129
Output for 5.2.7, 5.3.23
data: 0.95367431640625 Mbresult = 0.00024318695068359
Output for 5.3.22
data: 0.95367431640625 Mbresult = 0.00028109550476074
Output for 5.3.21
data: 0.95367431640625 Mbresult = 0.00032210350036621
Output for 5.3.20
data: 0.95367431640625 Mbresult = 0.00031781196594238
Output for 5.3.18
data: 0.95367431640625 Mbresult = 0.00031304359436035
Output for 5.3.17
data: 0.95367431640625 Mbresult = 0.00037193298339844
Output for 5.3.14
data: 0.95367431640625 Mbresult = 0.0002751350402832
Output for 5.3.13
data: 0.95367431640625 Mbresult = 0.00027704238891602
Output for 5.3.12
data: 0.95367431640625 Mbresult = 0.0003359317779541
Output for 5.3.11
data: 0.95367431640625 Mbresult = 0.00017118453979492
Output for 5.3.10
data: 0.95367431640625 Mbresult = 0.0002439022064209
Output for 5.3.9
data: 0.95367431640625 Mbresult = 0.00018191337585449
Output for 5.3.8
data: 0.95367431640625 Mbresult = 0.00030088424682617
Output for 5.3.6
data: 0.95367431640625 Mbresult = 0.00026583671569824
Output for 5.3.5
data: 0.95367431640625 Mbresult = 0.0001678466796875
Output for 5.3.2
data: 0.95367431640625 Mbresult = 0.0002591609954834
Output for 5.3.0
data: 0.95367431640625 Mbresult = 0.00030994415283203
Output for 5.2.17
data: 0.95367431640625 Mbresult = 0.00017714500427246
Output for 5.2.16
data: 0.95367431640625 Mbresult = 0.0003049373626709
Output for 5.2.15
data: 0.95367431640625 Mbresult = 0.00029897689819336
Output for 5.2.13
data: 0.95367431640625 Mbresult = 0.00029921531677246
Output for 5.2.12
data: 0.95367431640625 Mbresult = 0.00039482116699219
Output for 5.2.10 - 5.2.11
data: 0.95367431640625 Mbresult = 0.00030398368835449
Output for 5.2.9
data: 0.95367431640625 Mbresult = 0.0003201961517334
Output for 5.2.8
data: 0.95367431640625 Mbresult = 0.00032901763916016
Output for 5.2.6
data: 0.95367431640625 Mbresult = 0.00031113624572754
Output for 5.2.5
data: 0.95367431640625 Mbresult = 0.00025320053100586
Output for 5.2.4
data: 0.95367431640625 Mbresult = 0.00030016899108887
Output for 5.2.3
data: 0.95367431640625 Mbresult = 0.00041007995605469
Output for 5.2.2
data: 0.95367431640625 Mbresult = 0.00027990341186523
Output for 5.2.0
data: 0.95367431640625 Mbresult = 0.00033998489379883
Output for 5.1.6
data: 0.95367431640625 Mbresult = 0.00031399726867676
Output for 5.1.5
data: 0.95367431640625 Mbresult = 0.00031280517578125
Output for 5.1.4
data: 0.95367431640625 Mbresult = 0.00026488304138184
Output for 5.1.3
data: 0.95367431640625 Mbresult = 0.00029301643371582
Output for 5.1.2
data: 0.95367431640625 Mbresult = 0.00019598007202148
Output for 5.1.1
data: 0.95367431640625 Mbresult = 0.00018811225891113
Output for 5.1.0
data: 0.95367431640625 Mbresult = 0.00026178359985352
Output for 5.0.5
data: 0.95367431640625 Mbresult = 0.00031089782714844
Output for 5.0.4
data: 0.95367431640625 Mbresult = 0.00031208992004395
Output for 5.0.3
data: 0.95367431640625 Mbresult = 0.00041413307189941
Output for 5.0.2
data: 0.95367431640625 Mbresult = 0.00054287910461426
Output for 5.0.1
data: 0.95367431640625 Mbresult = 0.00050091743469238
Output for 5.0.0
data: 0.95367431640625 Mbresult = 0.00057792663574219
Output for 4.4.9
data: 0.95367431640625 Mbresult = 0.00058200000000003
Output for 4.4.8
data: 0.95367431640625 Mbresult = 0.00046299999999999
Output for 4.4.7
data: 0.95367431640625 Mbresult = 0.000421
Output for 4.4.6
data: 0.95367431640625 Mbresult = 0.00030600000000003
Output for 4.4.5
data: 0.95367431640625 Mbresult = 0.000496
Output for 4.4.4
data: 0.95367431640625 Mbresult = 0.00054600000000002
Output for 4.4.3
data: 0.95367431640625 Mbresult = 0.00050300000000003
Output for 4.4.2
data: 0.95367431640625 Mbresult = 0.00032699999999997
Output for 4.4.1
data: 0.95367431640625 Mbresult = 0.00044699999999998
Output for 4.4.0
data: 0.95367431640625 Mbresult = 0.00036799999999992
Output for 4.3.11
data: 0.95367431640625 Mbresult = 0.000386
Output for 4.3.10
data: 0.95367431640625 Mbresult = 0.00045700000000004
Output for 4.3.9
data: 0.95367431640625 Mbresult = 0.00040999999999999
Output for 4.3.8
data: 0.95367431640625 Mbresult = 0.00045600000000001
Output for 4.3.7
data: 0.95367431640625 Mbresult = 0.00042799999999998
Output for 4.3.6
data: 0.95367431640625 Mbresult = 0.00059600000000004
Output for 4.3.5
data: 0.95367431640625 Mbresult = 0.00061900000000004
Output for 4.3.4
data: 0.95367431640625 Mbresult = 0.00034999999999996
Output for 4.3.3
data: 0.95367431640625 Mbresult = 0.00051599999999996