3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function recurseBenchCallerContex($iterations, $recursionLimit) { if($recursionLimit > 0) { $this->recurseBenchCallerContex($iterations, $recursionLimit - 1); } $start = microtime(true); for($c = 0; $c < $iterations; $c++) { $class = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['class']; } var_dump('debug_backtrace', microtime(true) - $start); $start = microtime(true); for($c = 0; $c < $iterations; $c++) { $class = get_called_class(); } $start = microtime(true); } } $foo = new Foo; $foo->recurseBenchCallerContex(1, 0);
based on gsZfI
Output for 5.5.30, 5.6.10, 7.1.0
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(2.1934509277344E-5)
Output for 5.5.24, 7.0.14
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(2.5033950805664E-5)
Output for 5.5.35, 7.0.6
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(2.288818359375E-5)
Output for 5.5.34, 7.0.5
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(1.7166137695312E-5)
Output for 7.0.4
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(1.8835067749023E-5)
Output for 5.4.39, 5.4.45, 7.0.3
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(3.0994415283203E-5)
Output for 5.6.14, 5.6.18 - 5.6.19, 7.0.2
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(2.4080276489258E-5)
Output for 5.4.41, 5.5.28, 5.6.8, 7.0.1
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(2.3841857910156E-5)
Output for 7.0.0
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(1.7881393432617E-5)
Output for 5.6.28
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(2.8133392333984E-5)
Output for 5.6.9, 5.6.11 - 5.6.13, 5.6.21
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(2.598762512207E-5)
Output for 5.6.20
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(1.5020370483398E-5)
Output for 5.5.27, 5.6.17
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(2.0027160644531E-5)
Output for 5.6.16
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(2.6941299438477E-5)
Output for 5.4.43, 5.6.15
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(2.7179718017578E-5)
Output for 5.6.7
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(1.9073486328125E-5)
Output for 5.5.33
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(1.4066696166992E-5)
Output for 5.5.32
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(1.5974044799805E-5)
Output for 5.5.31
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(1.6927719116211E-5)
Output for 5.5.29
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(2.2172927856445E-5)
Output for 5.5.26
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(1.978874206543E-5)
Output for 5.5.25
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(1.3828277587891E-5)
Output for 5.4.44
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(0.0070681571960449)
Output for 5.4.42
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(0.0067880153656006)
Output for 5.4.40
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(0.015327930450439)
Output for 5.4.38
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(0.00016498565673828)
Output for 5.4.37
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(0.00015783309936523)
Output for 5.4.36
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(7.3909759521484E-5)
Output for 5.4.35
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(0.0088038444519043)
Output for 5.4.34
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(6.5803527832031E-5)
Output for 5.4.32
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(6.6995620727539E-5)
Output for 5.4.31
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(7.4863433837891E-5)
Output for 5.4.2, 5.4.17, 5.4.19, 5.4.22 - 5.4.23, 5.4.30
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(6.1988830566406E-5)
Output for 5.4.29
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(6.5088272094727E-5)
Output for 5.4.25, 5.4.28
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(6.0081481933594E-5)
Output for 5.4.27
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(7.1048736572266E-5)
Output for 5.4.6, 5.4.8, 5.4.26
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(5.6982040405273E-5)
Output for 5.4.24
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(5.8174133300781E-5)
Output for 5.4.21
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(6.103515625E-5)
Output for 5.4.11, 5.4.20
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(6.2942504882812E-5)
Output for 5.4.18
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(8.4161758422852E-5)
Output for 5.4.10, 5.4.16
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(6.4849853515625E-5)
Output for 5.4.0, 5.4.15
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(5.8889389038086E-5)
Output for 5.4.14
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(5.6028366088867E-5)
Output for 5.4.13
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(7.2002410888672E-5)
Output for 5.4.12
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(3.3855438232422E-5)
Output for 5.4.9
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(5.9843063354492E-5)
Output for 5.4.7
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(6.0796737670898E-5)
Output for 5.4.5
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(6.9141387939453E-5)
Output for 5.4.4
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(5.9127807617188E-5)
Output for 5.4.3
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(6.9856643676758E-5)
Output for 5.4.1
Notice: Undefined offset: 1 in /in/4SpqB on line 14 string(15) "debug_backtrace" float(5.4836273193359E-5)
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/4SpqB on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/4SpqB on line 14
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/4SpqB on line 14
Process exited with code 255.