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); var_dump('get_called_class', microtime(true) - $start); } } $foo = new Foo; $foo->recurseBenchCallerContex(1, 0);
based on 4SpqB
Output for 7.1.0
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.3126602172852E-5) string(16) "get_called_class" float(0)
Output for 5.5.33, 7.0.14
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.288818359375E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.16, 7.0.6
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.4080276489258E-5) string(16) "get_called_class" float(0)
Output for 7.0.2, 7.0.5
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(1.6927719116211E-5) string(16) "get_called_class" float(0)
Output for 5.5.32, 5.6.19, 7.0.4
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.5033950805664E-5) string(16) "get_called_class" float(0)
Output for 7.0.3
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(1.8835067749023E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.15, 7.0.1
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(1.9073486328125E-5) string(16) "get_called_class" float(0)
Output for 5.5.29 - 5.5.30, 5.6.7, 5.6.17, 7.0.0
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.0980834960938E-5) string(16) "get_called_class" float(0)
Output for hhvm-3.12.0
Notice: Undefined index: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(0.0003211498260498) string(16) "get_called_class" float(9.5367431640625E-7)
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.28
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.6941299438477E-5) string(16) "get_called_class" float(0)
Output for 5.6.8 - 5.6.9, 5.6.12, 5.6.21
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.598762512207E-5) string(16) "get_called_class" float(0)
Output for 5.5.27, 5.6.20
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.8133392333984E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.31, 5.6.18
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.3841857910156E-5) string(16) "get_called_class" float(0)
Output for 5.6.14
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(1.8119812011719E-5) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.6.13
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(1.5974044799805E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.11
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.598762512207E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.10
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(1.5974044799805E-5) string(16) "get_called_class" float(0)
Output for 5.5.35
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.3126602172852E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.34
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.1934509277344E-5) string(16) "get_called_class" float(0)
Output for 5.5.28
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.9087066650391E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.26
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.0027160644531E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.25
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.4795532226562E-5) string(16) "get_called_class" float(0)
Output for 5.5.24
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(1.4066696166992E-5) string(16) "get_called_class" float(0)
Output for 5.4.45
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(3.9815902709961E-5) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.4.44
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(0.00010991096496582) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.43
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(3.0994415283203E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.42
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(4.0054321289062E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.19, 5.4.41
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.793571472168E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.40
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(2.288818359375E-5) string(16) "get_called_class" float(0)
Output for 5.4.39
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(3.4809112548828E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.38
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(0.00011897087097168) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.4.37
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(4.9829483032227E-5) string(16) "get_called_class" float(0)
Output for 5.4.36
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(9.8228454589844E-5) string(16) "get_called_class" float(0)
Output for 5.4.35
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(8.6069107055664E-5) string(16) "get_called_class" float(0)
Output for 5.4.34
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(0.00011110305786133) string(16) "get_called_class" float(0)
Output for 5.4.25, 5.4.32
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(6.5088272094727E-5) string(16) "get_called_class" float(0)
Output for 5.4.14, 5.4.31
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(6.1988830566406E-5) string(16) "get_called_class" float(0)
Output for 5.4.30
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.4121017456055E-5) string(16) "get_called_class" float(0)
Output for 5.4.4, 5.4.29
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(6.103515625E-5) string(16) "get_called_class" float(0)
Output for 5.4.28
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(7.5817108154297E-5) string(16) "get_called_class" float(0)
Output for 5.4.27
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.6028366088867E-5) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.4.26
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(7.1048736572266E-5) string(16) "get_called_class" float(0)
Output for 5.4.24
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.5074691772461E-5) string(16) "get_called_class" float(0)
Output for 5.4.13, 5.4.23
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(6.2942504882812E-5) string(16) "get_called_class" float(0)
Output for 5.4.22
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.5789947509766E-5) string(16) "get_called_class" float(0)
Output for 5.4.21
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.6028366088867E-5) string(16) "get_called_class" float(0)
Output for 5.4.20
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.6982040405273E-5) string(16) "get_called_class" float(0)
Output for 5.4.18
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(6.4849853515625E-5) string(16) "get_called_class" float(0)
Output for 5.4.17
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(7.7009201049805E-5) string(16) "get_called_class" float(0)
Output for 5.4.16
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(6.6995620727539E-5) string(16) "get_called_class" float(0)
Output for 5.4.15
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(6.6041946411133E-5) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.12
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(3.2901763916016E-5) string(16) "get_called_class" float(0)
Output for 5.4.2, 5.4.11
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.8174133300781E-5) string(16) "get_called_class" float(0)
Output for 5.4.10
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.9127807617188E-5) string(16) "get_called_class" float(0)
Output for 5.4.9
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.4836273193359E-5) string(16) "get_called_class" float(0)
Output for 5.4.8
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(7.0810317993164E-5) string(16) "get_called_class" float(0)
Output for 5.4.7
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.793571472168E-5) string(16) "get_called_class" float(0)
Output for 5.4.6
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.8889389038086E-5) string(16) "get_called_class" float(0)
Output for 5.4.5
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(6.7949295043945E-5) string(16) "get_called_class" float(0)
Output for 5.4.3
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(5.9843063354492E-5) string(16) "get_called_class" float(0)
Output for 5.4.1
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(6.8187713623047E-5) string(16) "get_called_class" float(0)
Output for 5.4.0
Notice: Undefined offset: 1 in /in/vrcGi on line 14 string(15) "debug_backtrace" float(4.887580871582E-5) string(16) "get_called_class" float(0)
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/vrcGi 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/vrcGi on line 14
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/vrcGi on line 14
Process exited with code 255.