3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { public function foo() { $start = microtime(true); for ($i=0; $i<1e5; $i++) { $a=get_called_class(); } $end = microtime(true); echo "Took: ", ($end-$start)*1e3, " ms"; $start = microtime(true); for ($i=0; $i<1e5; $i++) { $a=static::class; } $end = microtime(true); echo "Took: ", ($end-$start)*1e3, " ms"; } } $obj = new Test; $obj->foo();
based on QMW1q
Output for 7.1.0
Took: 4.3530464172363 msTook: 2.9318332672119 ms
Output for 7.0.14
Took: 3.9341449737549 msTook: 2.3958683013916 ms
Output for 7.0.10
Took: 2.3419857025146 msTook: 1.3699531555176 ms
Output for 7.0.9
Took: 3.0338764190674 msTook: 1.8157958984375 ms
Output for 7.0.8
Took: 5.1360130310059 msTook: 2.9048919677734 ms
Output for 7.0.7
Took: 2.324104309082 msTook: 1.3699531555176 ms
Output for 7.0.6
Took: 3.4830570220947 msTook: 2.068042755127 ms
Output for 7.0.5
Took: 2.9439926147461 msTook: 1.8599033355713 ms
Output for 7.0.4
Took: 3.8251876831055 msTook: 2.2962093353271 ms
Output for 7.0.3
Took: 3.7379264831543 msTook: 1.7828941345215 ms
Output for 7.0.2
Took: 3.6759376525879 msTook: 1.9841194152832 ms
Output for 7.0.1
Took: 3.2739639282227 msTook: 1.9309520721436 ms
Output for 7.0.0
Took: 3.5879611968994 msTook: 2.2640228271484 ms
Output for hhvm-3.12.0
Took: 9.8609924316406 msTook: 6.1280727386475 ms
Output for hhvm-3.10.0
Took: 11.856079101562 msTook: 8.7330341339111 ms
Output for 5.6.28
Took: 13.000011444092 msTook: 12.024879455566 ms
Output for 5.6.25
Took: 9.4301700592041 msTook: 5.9800148010254 ms
Output for 5.6.24
Took: 12.184143066406 msTook: 8.5461139678955 ms
Output for 5.6.23
Took: 10.142087936401 msTook: 7.1840286254883 ms
Output for 5.6.22
Took: 10.885953903198 msTook: 8.9008808135986 ms
Output for 5.6.21
Took: 7.7600479125977 msTook: 5.6889057159424 ms
Output for 5.6.20
Took: 11.152029037476 msTook: 6.8399906158447 ms
Output for 5.6.19
Took: 9.4230175018311 msTook: 5.7671070098877 ms
Output for 5.6.18
Took: 13.346910476685 msTook: 8.9879035949707 ms
Output for 5.6.17
Took: 11.309862136841 msTook: 7.8680515289307 ms
Output for 5.6.16
Took: 10.081768035889 msTook: 6.2069892883301 ms
Output for 5.6.15
Took: 11.029958724976 msTook: 8.1009864807129 ms
Output for 5.6.14
Took: 7.9529285430908 msTook: 5.6710243225098 ms
Output for 5.6.13
Took: 11.352062225342 msTook: 6.4139366149902 ms
Output for 5.6.12
Took: 13.120889663696 msTook: 6.3331127166748 ms
Output for 5.6.11
Took: 8.2099437713623 msTook: 5.5670738220215 ms
Output for 5.6.10
Took: 10.87498664856 msTook: 7.9069137573242 ms
Output for 5.6.9
Took: 11.439085006714 msTook: 8.0051422119141 ms
Output for 5.6.8
Took: 10.603189468384 msTook: 7.0850849151611 ms
Output for 5.6.7
Took: 11.273860931396 msTook: 8.0611705780029 ms
Output for 5.6.6
Took: 11.821985244751 msTook: 7.9019069671631 ms
Output for 5.6.5
Took: 10.022878646851 msTook: 7.3809623718262 ms
Output for 5.6.4
Took: 11.858940124512 msTook: 8.2340240478516 ms
Output for 5.6.3
Took: 11.936902999878 msTook: 8.5189342498779 ms
Output for 5.6.2
Took: 9.2599391937256 msTook: 6.9749355316162 ms
Output for 5.6.1
Took: 10.653972625732 msTook: 7.7471733093262 ms
Output for 5.6.0
Took: 17.632961273193 msTook: 11.799097061157 ms
Output for 5.5.38
Took: 9.7489356994629 msTook: 8.0947875976562 ms
Output for 5.5.37
Took: 9.5319747924805 msTook: 10.052919387817 ms
Output for 5.5.36
Took: 11.162996292114 msTook: 10.900020599365 ms
Output for 5.5.35
Took: 10.426998138428 msTook: 10.313034057617 ms
Output for 5.5.34
Took: 10.491847991943 msTook: 11.284112930298 ms
Output for 5.5.33
Took: 12.317180633545 msTook: 11.812925338745 ms
Output for 5.5.32
Took: 12.003898620605 msTook: 11.723041534424 ms
Output for 5.5.31
Took: 12.56799697876 msTook: 11.781930923462 ms
Output for 5.5.30
Took: 11.615037918091 msTook: 11.237144470215 ms
Output for 5.5.29
Took: 11.943101882935 msTook: 11.786222457886 ms
Output for 5.5.28
Took: 9.9470615386963 msTook: 10.457992553711 ms
Output for 5.5.27
Took: 10.902166366577 msTook: 10.714054107666 ms
Output for 5.5.26
Took: 10.658979415894 msTook: 10.272979736328 ms
Output for 5.5.25
Took: 8.4948539733887 msTook: 8.0490112304688 ms
Output for 5.5.24
Took: 11.523962020874 msTook: 11.552095413208 ms
Output for 5.5.23
Took: 10.907888412476 msTook: 10.982036590576 ms
Output for 5.5.22
Took: 11.760950088501 msTook: 10.974884033203 ms
Output for 5.5.21
Took: 10.050058364868 msTook: 10.210990905762 ms
Output for 5.5.20
Took: 7.889986038208 msTook: 8.1629753112793 ms
Output for 5.5.19
Took: 9.7510814666748 msTook: 9.3162059783936 ms
Output for 5.5.18
Took: 10.625839233398 msTook: 10.721921920776 ms
Output for 5.5.16
Took: 9.6700191497803 msTook: 10.593175888062 ms
Output for 5.5.15
Took: 12.279987335205 msTook: 17.516136169434 ms
Output for 5.5.14
Took: 10.118961334229 msTook: 10.186910629272 ms
Output for 5.5.13
Took: 11.566162109375 msTook: 9.0820789337158 ms
Output for 5.5.12
Took: 11.778116226196 msTook: 11.551856994629 ms
Output for 5.5.11
Took: 11.741161346436 msTook: 10.022163391113 ms
Output for 5.5.10
Took: 11.523008346558 msTook: 11.346101760864 ms
Output for 5.5.9
Took: 8.7380409240723 msTook: 8.6398124694824 ms
Output for 5.5.8
Took: 12.256145477295 msTook: 12.194156646729 ms
Output for 5.5.7
Took: 12.2971534729 msTook: 12.396812438965 ms
Output for 5.5.6
Took: 10.554075241089 msTook: 11.276006698608 ms
Output for 5.5.5
Took: 12.037992477417 msTook: 14.345169067383 ms
Output for 5.5.4
Took: 7.843017578125 msTook: 7.641077041626 ms
Output for 5.5.3
Took: 12.732028961182 msTook: 12.562990188599 ms
Output for 5.5.2
Took: 11.293888092041 msTook: 10.894060134888 ms
Output for 5.5.1
Took: 9.4459056854248 msTook: 9.5429420471191 ms
Output for 5.5.0
Took: 13.635873794556 msTook: 11.908054351807 ms
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/0BXqt on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' in /in/0BXqt on line 10
Process exited with code 255.
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STATIC in /in/0BXqt on line 10
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STATIC in /in/0BXqt on line 10
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/0BXqt on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/0BXqt on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/0BXqt on line 4
Process exited with code 255.