3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(PHP_VERSION_ID <= 50400) { return; } class Foo { function recurseBenchCallerContex($iterations, $recursionLimit) { if($recursionLimit > 0) { return $this->recurseBenchCallerContex($iterations, $recursionLimit - 1); } $start = microtime(true); for($c = 0; $c < $iterations; $c++) { $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); $class = isset($trace[1]['class']) ? $trace[1]['class'] : null; } 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(10000, 100);
Output for 7.2.0
string(15) "debug_backtrace" float(0.0038259029388428) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.1.7
string(15) "debug_backtrace" float(0.0041241645812988) string(16) "get_called_class" float(0)
Output for 7.1.6
string(15) "debug_backtrace" float(0.0035960674285889) string(16) "get_called_class" float(0)
Output for 7.1.5
string(15) "debug_backtrace" float(0.0027391910552979) string(16) "get_called_class" float(0)
Output for 7.1.0
string(15) "debug_backtrace" float(0.0046870708465576) string(16) "get_called_class" float(0)
Output for 7.0.20
string(15) "debug_backtrace" float(0.0053508281707764) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.0.14
string(15) "debug_backtrace" float(0.0090610980987549) string(16) "get_called_class" float(0)
Output for 7.0.6
string(15) "debug_backtrace" float(0.0071759223937988) string(16) "get_called_class" float(0)
Output for 7.0.5
string(15) "debug_backtrace" float(0.0068199634552002) string(16) "get_called_class" float(0)
Output for 7.0.4
string(15) "debug_backtrace" float(0.0051479339599609) string(16) "get_called_class" float(0)
Output for 7.0.3
string(15) "debug_backtrace" float(0.0069420337677002) string(16) "get_called_class" float(0)
Output for 7.0.2
string(15) "debug_backtrace" float(0.0076048374176025) string(16) "get_called_class" float(0)
Output for 7.0.1
string(15) "debug_backtrace" float(0.0082261562347412) string(16) "get_called_class" float(0)
Output for 7.0.0
string(15) "debug_backtrace" float(0.007498025894165) string(16) "get_called_class" float(0)
Output for 5.6.28
string(15) "debug_backtrace" float(0.017398118972778) string(16) "get_called_class" float(0)
Output for 5.6.21
string(15) "debug_backtrace" float(0.0098321437835693) string(16) "get_called_class" float(0)
Output for 5.6.20
string(15) "debug_backtrace" float(0.013800859451294) string(16) "get_called_class" float(0)
Output for 5.6.19
string(15) "debug_backtrace" float(0.011592149734497) string(16) "get_called_class" float(0)
Output for 5.6.18
string(15) "debug_backtrace" float(0.0091750621795654) string(16) "get_called_class" float(0)
Output for 5.6.17
string(15) "debug_backtrace" float(0.0092999935150146) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.16
string(15) "debug_backtrace" float(0.0093009471893311) string(16) "get_called_class" float(0)
Output for 5.6.15
string(15) "debug_backtrace" float(0.015146017074585) string(16) "get_called_class" float(0)
Output for 5.6.14
string(15) "debug_backtrace" float(0.012319087982178) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.13
string(15) "debug_backtrace" float(0.01277494430542) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.12
string(15) "debug_backtrace" float(0.014497041702271) string(16) "get_called_class" float(0)
Output for 5.6.11
string(15) "debug_backtrace" float(0.013919115066528) string(16) "get_called_class" float(0)
Output for 5.6.10
string(15) "debug_backtrace" float(0.013158082962036) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.9
string(15) "debug_backtrace" float(0.012953996658325) string(16) "get_called_class" float(0)
Output for 5.6.8
string(15) "debug_backtrace" float(0.012799024581909) string(16) "get_called_class" float(0)
Output for 5.6.7
string(15) "debug_backtrace" float(0.0077579021453857) string(16) "get_called_class" float(0)
Output for 5.5.35
string(15) "debug_backtrace" float(0.012640953063965) string(16) "get_called_class" float(0)
Output for 5.5.34
string(15) "debug_backtrace" float(0.0094609260559082) string(16) "get_called_class" float(0)
Output for 5.5.33
string(15) "debug_backtrace" float(0.011928081512451) string(16) "get_called_class" float(0)
Output for 5.5.32
string(15) "debug_backtrace" float(0.012176036834717) string(16) "get_called_class" float(0)
Output for 5.5.31
string(15) "debug_backtrace" float(0.012258052825928) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.30
string(15) "debug_backtrace" float(0.014888048171997) string(16) "get_called_class" float(0)
Output for 5.5.29
string(15) "debug_backtrace" float(0.015223026275635) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.28
string(15) "debug_backtrace" float(0.013856887817383) string(16) "get_called_class" float(0)
Output for 5.5.27
string(15) "debug_backtrace" float(0.016418218612671) string(16) "get_called_class" float(0)
Output for 5.5.26
string(15) "debug_backtrace" float(0.011338949203491) string(16) "get_called_class" float(0)
Output for 5.5.25
string(15) "debug_backtrace" float(0.01437520980835) string(16) "get_called_class" float(0)
Output for 5.5.24
string(15) "debug_backtrace" float(0.027460098266602) string(16) "get_called_class" float(0)
Output for 5.4.45
string(15) "debug_backtrace" float(0.013730049133301) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.44
string(15) "debug_backtrace" float(0.04994797706604) string(16) "get_called_class" float(0)
Output for 5.4.43
string(15) "debug_backtrace" float(0.044250011444092) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.42
string(15) "debug_backtrace" float(0.036221981048584) string(16) "get_called_class" float(0)
Output for 5.4.41
string(15) "debug_backtrace" float(0.053646802902222) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.40
string(15) "debug_backtrace" float(0.013631105422974) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.4.39
string(15) "debug_backtrace" float(0.0080568790435791) string(16) "get_called_class" float(0)
Output for 5.4.38
string(15) "debug_backtrace" float(0.026317834854126) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.37
string(15) "debug_backtrace" float(0.026256084442139) string(16) "get_called_class" float(3.0994415283203E-6)
Output for 5.4.36
string(15) "debug_backtrace" float(0.03527307510376) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.35
string(15) "debug_backtrace" float(0.025721073150635) string(16) "get_called_class" float(3.0994415283203E-6)
Output for 5.4.34
string(15) "debug_backtrace" float(0.016690969467163) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.32
string(15) "debug_backtrace" float(0.014312028884888) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.31
string(15) "debug_backtrace" float(0.014363050460815) string(16) "get_called_class" float(1.9073486328125E-6)
Output for 5.4.30
string(15) "debug_backtrace" float(0.016733884811401) string(16) "get_called_class" float(1.9073486328125E-6)
Output for 5.4.29
string(15) "debug_backtrace" float(0.011643886566162) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.4.28
string(15) "debug_backtrace" float(0.012846946716309) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.27
string(15) "debug_backtrace" float(0.012041807174683) string(16) "get_called_class" float(2.1457672119141E-6)
Output for 5.4.26
string(15) "debug_backtrace" float(0.011284828186035) string(16) "get_called_class" float(0)
Output for 5.4.25
string(15) "debug_backtrace" float(0.011924982070923) string(16) "get_called_class" float(0)
Output for 5.4.24
string(15) "debug_backtrace" float(0.011952877044678) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.4.23
string(15) "debug_backtrace" float(0.011670827865601) string(16) "get_called_class" float(0)
Output for 5.4.22
string(15) "debug_backtrace" float(0.011981964111328) string(16) "get_called_class" float(0)
Output for 5.4.21
string(15) "debug_backtrace" float(0.01159405708313) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.20
string(15) "debug_backtrace" float(0.010972023010254) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.19
string(15) "debug_backtrace" float(0.012804985046387) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.18
string(15) "debug_backtrace" float(0.011914014816284) string(16) "get_called_class" float(0)
Output for 5.4.17
string(15) "debug_backtrace" float(0.011557102203369) string(16) "get_called_class" float(2.1457672119141E-6)
Output for 5.4.16
string(15) "debug_backtrace" float(0.011259078979492) string(16) "get_called_class" float(0)
Output for 5.4.15
string(15) "debug_backtrace" float(0.011254072189331) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.14
string(15) "debug_backtrace" float(0.011873960494995) string(16) "get_called_class" float(0)
Output for 5.4.13
string(15) "debug_backtrace" float(0.011725187301636) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.12
string(15) "debug_backtrace" float(0.012451887130737) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.11
string(15) "debug_backtrace" float(0.020272016525269) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.10
string(15) "debug_backtrace" float(0.012814998626709) string(16) "get_called_class" float(1.0013580322266E-5)
Output for 5.4.9
string(15) "debug_backtrace" float(0.013100147247314) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.8
string(15) "debug_backtrace" float(0.01158618927002) string(16) "get_called_class" float(0)
Output for 5.4.7
string(15) "debug_backtrace" float(0.011806964874268) string(16) "get_called_class" float(0)
Output for 5.4.6
string(15) "debug_backtrace" float(0.012255907058716) string(16) "get_called_class" float(1.9073486328125E-6)
Output for 5.4.5
string(15) "debug_backtrace" float(0.01239800453186) string(16) "get_called_class" float(0)
Output for 5.4.4
string(15) "debug_backtrace" float(0.012248992919922) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.3
string(15) "debug_backtrace" float(0.012325048446655) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.2
string(15) "debug_backtrace" float(0.012721061706543) string(16) "get_called_class" float(0)
Output for 5.4.1
string(15) "debug_backtrace" float(0.016102075576782) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.2.7 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.6
Notice: Use of undefined constant PHP_VERSION_ID - assumed 'PHP_VERSION_ID' in /in/WXg8M on line 3

preferences:
174.51 ms | 402 KiB | 175 Q