3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // 1 $time = microtime(true); for($i = 0; $i < 10000; $i++) { assert(1024 * 256 === strlen(str_repeat('x', 1024 * 256))); } echo microtime(true) - $time . "\n"; // 2 $time = microtime(true); for($i = 0; $i < 10000; $i++) { assert(1024 * 256 === strlen(str_repeat('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 1024))); } echo microtime(true) - $time . "\n"; // 3 $time = microtime(true); for($i = 0; $i < 10000; $i++) { assert(1024 * 256 === sizeof(array_fill(0, 1024 * 256, 1))); } echo microtime(true) - $time . "\n"; // 4 $time = microtime(true); for($i = 0; $i < 10000; $i++) { assert(1024 * 256 === strlen(implode('', array_fill(0, 1024 * 256, 1)))); } echo microtime(true) - $time . "\n";
Output for 5.4.16
0.11084914207458 0.11027503013611
Process exited with code 137.
Output for 5.4.15
0.12544202804565 0.19036412239075
Process exited with code 137.
Output for 5.4.14
0.085095882415771 0.09928297996521
Process exited with code 137.
Output for 5.4.13
0.10031700134277 0.12541913986206
Process exited with code 137.
Output for 5.4.12
0.1294219493866 0.16211915016174
Process exited with code 137.
Output for 5.4.11
0.087627172470093 0.1076340675354
Process exited with code 137.
Output for 5.4.10
0.12923002243042 0.15965819358826
Process exited with code 137.
Output for 5.4.9
0.12323999404907 0.15686082839966
Process exited with code 137.
Output for 5.4.8
0.091784000396729 0.10773110389709
Process exited with code 137.
Output for 5.4.7
0.12571501731873 0.1514630317688
Process exited with code 137.
Output for 5.4.6
0.10095000267029 0.11050891876221
Process exited with code 137.
Output for 5.4.5
0.087162971496582 0.10189199447632
Process exited with code 137.
Output for 5.4.4
0.12839794158936 0.15410685539246
Process exited with code 137.
Output for 5.4.3
0.090821981430054 0.11135816574097
Process exited with code 137.
Output for 5.4.2
0.10318899154663 0.14669799804688
Process exited with code 137.
Output for 5.4.1
0.10545992851257 0.11196303367615
Process exited with code 137.
Output for 5.4.0
0.11963701248169 0.14886093139648
Process exited with code 137.
Output for 5.3.26
0.088824033737183 0.10995984077454
Process exited with code 137.
Output for 5.3.25
0.10557699203491 0.1110200881958
Process exited with code 137.
Output for 5.3.24
0.14099812507629 0.19815993309021
Process exited with code 137.
Output for 5.3.23
0.089301109313965 0.11105108261108
Process exited with code 137.
Output for 5.3.22
0.087977886199951 0.11164307594299
Process exited with code 137.
Output for 5.3.21
0.091361045837402 0.1463029384613
Process exited with code 137.
Output for 5.3.20
0.19106507301331 0.16765999794006
Process exited with code 137.
Output for 5.3.19
0.13037300109863 0.16683101654053
Process exited with code 137.
Output for 5.3.18
0.12986207008362 0.1599280834198
Process exited with code 137.
Output for 5.3.17
0.13367390632629 0.16230893135071
Process exited with code 137.
Output for 5.3.16
0.13115406036377 0.15471386909485
Process exited with code 137.
Output for 5.3.15
0.086055040359497 0.10847616195679
Process exited with code 137.
Output for 5.3.14
0.15582418441772 0.17345309257507
Process exited with code 137.
Output for 5.3.13
0.1322979927063 0.21617794036865
Process exited with code 137.
Output for 5.3.12
0.12746214866638 0.15570998191833
Process exited with code 137.
Output for 5.3.11
0.12889218330383 0.15522813796997
Process exited with code 137.
Output for 5.3.10
0.13712906837463 0.16010403633118
Process exited with code 137.
Output for 5.3.9
0.13916707038879 0.16410899162292
Process exited with code 137.
Output for 5.3.8
0.090187072753906 0.10490489006042
Process exited with code 137.
Output for 5.3.7
0.097203016281128 0.10380291938782
Process exited with code 137.
Output for 5.3.6
0.10131216049194 0.13435888290405
Process exited with code 137.
Output for 5.3.5
0.1245641708374 0.15034103393555
Process exited with code 137.
Output for 5.3.4
0.10014510154724 0.13123083114624
Process exited with code 137.
Output for 5.3.3
0.098394155502319 0.11223793029785
Process exited with code 137.
Output for 5.3.2
0.13686084747314 0.15768599510193
Process exited with code 137.
Output for 5.3.1
0.1318941116333 0.16529703140259
Process exited with code 137.
Output for 5.3.0
0.090291976928711 0.10483694076538
Process exited with code 137.