3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php global $throw; $throw = false; function foo() { bar(); } function bar() { baz(); } function baz() { boom(); } function boom() { global $throw; if ($throw) { throw new RuntimeException(); } } function test($n) { for ($i = 0; $i < $n; $i++) { try { foo(); } catch (RuntimeException $e) { echo $e->getLine(); } } } $t = microtime(); test(1000000); echo (microtime() - $t) . ' us';
Output for 7.1.0
Notice: A non well formed numeric value encountered in /in/BSTLE on line 37 Notice: A non well formed numeric value encountered in /in/BSTLE on line 37 0.131362 us
Output for 7.0.14
0.143828 us
Output for 7.0.7
0.089777 us
Output for 7.0.6
0.121411 us
Output for 7.0.5
0.107071 us
Output for 7.0.4
0.121812 us
Output for 7.0.3
0.099096 us
Output for 7.0.2
0.117869 us
Output for 7.0.1
0.111385 us
Output for 7.0.0
0.095592 us
Output for 5.6.28
0.254317 us
Output for 5.6.22
0.21791 us
Output for 5.6.21
0.251586 us
Output for 5.6.20
0.252227 us
Output for 5.6.19
0.263901 us
Output for 5.6.18
0.276415 us
Output for 5.6.17
0.243808 us
Output for 5.6.16
0.232589 us
Output for 5.6.15
0.250681 us
Output for 5.6.14
0.218109 us
Output for 5.6.13
0.257967 us
Output for 5.6.12
0.247242 us
Output for 5.6.11
0.239955 us
Output for 5.6.10
0.242468 us
Output for 5.6.9
0.246739 us
Output for 5.6.8
0.230817 us
Output for 5.6.7
0.230778 us
Output for 5.6.6
0.230878 us
Output for 5.6.5
0.243249 us
Output for 5.6.4
0.228897 us
Output for 5.6.3
0.244986 us
Output for 5.6.2
0.252107 us
Output for 5.6.1
0.246564 us
Output for 5.6.0
0.251254 us
Output for 5.5.36
0.237912 us
Output for 5.5.35
0.217621 us
Output for 5.5.34
0.231157 us
Output for 5.5.33
0.227251 us
Output for 5.5.32
0.257223 us
Output for 5.5.31
0.225556 us
Output for 5.5.30
0.236238 us
Output for 5.5.29
0.238098 us
Output for 5.5.28
0.232267 us
Output for 5.5.27
0.248877 us
Output for 5.5.26
0.247881 us
Output for 5.5.25
0.240436 us
Output for 5.5.24
0.214086 us
Output for 5.5.23
0.218142 us
Output for 5.5.22
0.229825 us
Output for 5.5.21
0.217545 us
Output for 5.5.20
0.244319 us
Output for 5.5.19
0.216518 us
Output for 5.5.18
0.218139 us
Output for 5.5.16
0.224551 us
Output for 5.5.15
0.224849 us
Output for 5.5.14
0.241578 us
Output for 5.5.13
0.228878 us
Output for 5.5.12
0.22373 us
Output for 5.5.11
0.248822 us
Output for 5.5.10
0.226037 us
Output for 5.5.9
0.216296 us
Output for 5.5.8
0.240938 us
Output for 5.5.7
0.212781 us
Output for 5.5.6
0.254273 us
Output for 5.5.5
0.264674 us
Output for 5.5.4
0.218241 us
Output for 5.5.3
0.229204 us
Output for 5.5.2
0.227765 us
Output for 5.5.1
0.243139 us
Output for 5.5.0
0.225548 us
Output for 5.4.45
0.230034 us
Output for 5.4.44
0.209285 us
Output for 5.4.43
0.236567 us
Output for 5.4.42
0.208408 us
Output for 5.4.41
0.227391 us
Output for 5.4.40
0.252683 us
Output for 5.4.39
0.214743 us
Output for 5.4.38
0.242511 us
Output for 5.4.37
0.231433 us
Output for 5.4.36
0.254467 us
Output for 5.4.35
0.250463 us
Output for 5.4.34
0.209283 us
Output for 5.4.32
0.23486 us
Output for 5.4.31
0.254658 us
Output for 5.4.30
0.236592 us
Output for 5.4.29
0.272094 us
Output for 5.4.28
0.261505 us
Output for 5.4.27
0.242888 us
Output for 5.4.26
0.268614 us
Output for 5.4.25
0.250987 us
Output for 5.4.24
0.251805 us
Output for 5.4.23
0.259788 us
Output for 5.4.22
0.251646 us
Output for 5.4.21
0.265021 us
Output for 5.4.20
0.262995 us
Output for 5.4.19
0.259414 us
Output for 5.4.18
0.229283 us
Output for 5.4.17
0.196372 us
Output for 5.4.16
0.25333 us
Output for 5.4.15
0.248119 us
Output for 5.4.14
0.238224 us
Output for 5.4.13
0.241982 us
Output for 5.4.12
0.243599 us
Output for 5.4.11
0.205975 us
Output for 5.4.10
0.237222 us
Output for 5.4.9
0.215445 us
Output for 5.4.8
0.216536 us
Output for 5.4.7
0.209219 us
Output for 5.4.6
0.256404 us
Output for 5.4.5
0.213852 us
Output for 5.4.4
0.216351 us
Output for 5.4.3
0.230484 us
Output for 5.4.2
0.214263 us
Output for 5.4.1
0.21259 us
Output for 5.4.0
0.207204 us
Output for 5.3.29
0.496553 us
Output for 5.3.28
0.500087 us
Output for 5.3.27
0.485959 us
Output for 5.3.26
0.503225 us
Output for 5.3.25
0.525055 us
Output for 5.3.24
0.492006 us
Output for 5.3.23
0.508396 us
Output for 5.3.22
0.506193 us
Output for 5.3.21
0.506968 us
Output for 5.3.20
0.504451 us
Output for 5.3.19
0.47244 us
Output for 5.3.18
0.503081 us
Output for 5.3.17
0.501078 us
Output for 5.3.16
0.477212 us
Output for 5.3.15
0.488406 us
Output for 5.3.14
0.462845 us
Output for 5.3.13
0.514282 us
Output for 5.3.12
0.405189 us
Output for 5.3.11
0.498194 us
Output for 5.3.10
0.399334 us
Output for 5.3.9
0.453077 us
Output for 5.3.8
0.424059 us
Output for 5.3.7
0.393783 us
Output for 5.3.6
0.47668 us
Output for 5.3.5
0.384033 us
Output for 5.3.4
0.504561 us
Output for 5.3.3
0.50949 us
Output for 5.3.2
0.494221 us
Output for 5.3.1
0.486966 us
Output for 5.3.0
0.514608 us
Output for 5.2.17
0.587173 us
Output for 5.2.16
0.71377 us
Output for 5.2.15
0.723004 us
Output for 5.2.14
0.683459 us
Output for 5.2.13
0.727316 us
Output for 5.2.12
0.689091 us
Output for 5.2.11
0.676644 us
Output for 5.2.10
0.69246 us
Output for 5.2.9
0.715822 us
Output for 5.2.8
0.715631 us
Output for 5.2.7
0.713797 us
Output for 5.2.6
0.708563 us
Output for 5.2.5
0.686822 us
Output for 5.2.4
0.724047 us
Output for 5.2.3
0.685646 us
Output for 5.2.2
0.663496 us
Output for 5.2.1
0.680708 us
Output for 5.2.0
0.770189 us
Output for 5.1.6
0.750251 us
Output for 5.1.5
0.753332 us
Output for 5.1.4
0.766491 us
Output for 5.1.3
0.760441 us
Output for 5.1.2
0.748447 us
Output for 5.1.1
0.753775 us
Output for 5.1.0
0.775979 us
Output for 5.0.0 - 5.0.5
Fatal error: Class 'RuntimeException' not found in /in/BSTLE on line 29
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/BSTLE on line 21
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_NEW in /in/BSTLE on line 21
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/BSTLE on line 21
Process exited with code 255.