3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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);
based on WXg8M
Output for 7.1.0
string(15) "debug_backtrace" float(0.0048730373382568) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.0.14
string(15) "debug_backtrace" float(0.009113073348999) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.0.11
string(15) "debug_backtrace" float(0.0079989433288574) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.0.10
string(15) "debug_backtrace" float(0.0058739185333252) string(16) "get_called_class" float(0)
Output for 7.0.9
string(15) "debug_backtrace" float(0.0082018375396729) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.0.8
string(15) "debug_backtrace" float(0.0087409019470215) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.0.7
string(15) "debug_backtrace" float(0.008404016494751) string(16) "get_called_class" float(0)
Output for 7.0.6
string(15) "debug_backtrace" float(0.0082159042358398) string(16) "get_called_class" float(0)
Output for 7.0.5
string(15) "debug_backtrace" float(0.0082979202270508) string(16) "get_called_class" float(0)
Output for 7.0.4
string(15) "debug_backtrace" float(0.0083589553833008) string(16) "get_called_class" float(0)
Output for 7.0.3
string(15) "debug_backtrace" float(0.0064759254455566) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 7.0.2
string(15) "debug_backtrace" float(0.0084819793701172) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.0.1
string(15) "debug_backtrace" float(0.007476806640625) string(16) "get_called_class" float(0)
Output for 7.0.0
string(15) "debug_backtrace" float(0.006756067276001) string(16) "get_called_class" float(0)
Output for hhvm-3.13.2
string(15) "debug_backtrace" float(0.0082521438598633) string(16) "get_called_class" float(9.5367431640625E-7)
Output for hhvm-3.12.0
string(15) "debug_backtrace" float(0.0080358982086182) string(16) "get_called_class" float(9.5367431640625E-7)
Output for hhvm-3.10.0
string(15) "debug_backtrace" float(0.0089690685272217) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.28
string(15) "debug_backtrace" float(0.0061612129211426) string(16) "get_called_class" float(-9.5367431640625E-7)
Output for 5.6.26
string(15) "debug_backtrace" float(0.014786958694458) string(16) "get_called_class" float(0)
Output for 5.6.25
string(15) "debug_backtrace" float(0.014716148376465) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.24
string(15) "debug_backtrace" float(0.014978170394897) string(16) "get_called_class" float(0)
Output for 5.6.23
string(15) "debug_backtrace" float(0.014492988586426) string(16) "get_called_class" float(0)
Output for 5.6.22
string(15) "debug_backtrace" float(0.013010025024414) string(16) "get_called_class" float(0)
Output for 5.6.21
string(15) "debug_backtrace" float(0.012682914733887) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.20
string(15) "debug_backtrace" float(0.011467933654785) string(16) "get_called_class" float(0)
Output for 5.6.19
string(15) "debug_backtrace" float(0.014202117919922) string(16) "get_called_class" float(0)
Output for 5.6.18
string(15) "debug_backtrace" float(0.012183904647827) string(16) "get_called_class" float(0)
Output for 5.6.17
string(15) "debug_backtrace" float(0.01498818397522) string(16) "get_called_class" float(0)
Output for 5.6.16
string(15) "debug_backtrace" float(0.012523889541626) string(16) "get_called_class" float(0)
Output for 5.6.15
string(15) "debug_backtrace" float(0.01350212097168) string(16) "get_called_class" float(0)
Output for 5.6.14
string(15) "debug_backtrace" float(0.012437105178833) string(16) "get_called_class" float(0)
Output for 5.6.13
string(15) "debug_backtrace" float(0.011742830276489) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.12
string(15) "debug_backtrace" float(0.013077020645142) string(16) "get_called_class" float(0)
Output for 5.6.11
string(15) "debug_backtrace" float(0.014517068862915) string(16) "get_called_class" float(0)
Output for 5.6.10
string(15) "debug_backtrace" float(0.014774084091187) string(16) "get_called_class" float(0)
Output for 5.6.9
string(15) "debug_backtrace" float(0.0096039772033691) string(16) "get_called_class" float(0)
Output for 5.6.8
string(15) "debug_backtrace" float(0.011080980300903) string(16) "get_called_class" float(0)
Output for 5.6.7
string(15) "debug_backtrace" float(0.0095510482788086) string(16) "get_called_class" float(0)
Output for 5.6.6
string(15) "debug_backtrace" float(0.014228820800781) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.5
string(15) "debug_backtrace" float(0.014391899108887) string(16) "get_called_class" float(0)
Output for 5.6.4
string(15) "debug_backtrace" float(0.01540207862854) string(16) "get_called_class" float(0)
Output for 5.6.3
string(15) "debug_backtrace" float(0.014147043228149) string(16) "get_called_class" float(0)
Output for 5.6.2
string(15) "debug_backtrace" float(0.014780044555664) string(16) "get_called_class" float(0)
Output for 5.6.1
string(15) "debug_backtrace" float(0.014887094497681) string(16) "get_called_class" float(0)
Output for 5.6.0
string(15) "debug_backtrace" float(0.011753797531128) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.5.38
string(15) "debug_backtrace" float(0.016796827316284) string(16) "get_called_class" float(0)
Output for 5.5.37
string(15) "debug_backtrace" float(0.013542175292969) string(16) "get_called_class" float(0)
Output for 5.5.36
string(15) "debug_backtrace" float(0.014370918273926) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.35
string(15) "debug_backtrace" float(0.012341022491455) string(16) "get_called_class" float(0)
Output for 5.5.34
string(15) "debug_backtrace" float(0.014693975448608) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.33
string(15) "debug_backtrace" float(0.012727022171021) string(16) "get_called_class" float(0)
Output for 5.5.32
string(15) "debug_backtrace" float(0.015664100646973) string(16) "get_called_class" float(0)
Output for 5.5.31
string(15) "debug_backtrace" float(0.015531063079834) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.5.30
string(15) "debug_backtrace" float(0.015465974807739) string(16) "get_called_class" float(0)
Output for 5.5.29
string(15) "debug_backtrace" float(0.014111042022705) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.28
string(15) "debug_backtrace" float(0.011610984802246) string(16) "get_called_class" float(0)
Output for 5.5.27
string(15) "debug_backtrace" float(0.014241933822632) string(16) "get_called_class" float(0)
Output for 5.5.26
string(15) "debug_backtrace" float(0.0119469165802) string(16) "get_called_class" float(0)
Output for 5.5.25
string(15) "debug_backtrace" float(0.013577938079834) string(16) "get_called_class" float(0)
Output for 5.5.24
string(15) "debug_backtrace" float(0.015821218490601) string(16) "get_called_class" float(0)
Output for 5.5.23
string(15) "debug_backtrace" float(0.014358997344971) string(16) "get_called_class" float(0)
Output for 5.5.22
string(15) "debug_backtrace" float(0.014930963516235) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.21
string(15) "debug_backtrace" float(0.012850999832153) string(16) "get_called_class" float(0)
Output for 5.5.20
string(15) "debug_backtrace" float(0.012310028076172) string(16) "get_called_class" float(0)
Output for 5.5.19
string(15) "debug_backtrace" float(0.014721870422363) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.18
string(15) "debug_backtrace" float(0.011903047561646) string(16) "get_called_class" float(0)
Output for 5.5.16
string(15) "debug_backtrace" float(0.014590978622437) string(16) "get_called_class" float(0)
Output for 5.5.15
string(15) "debug_backtrace" float(0.012932062149048) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.14
string(15) "debug_backtrace" float(0.013027906417847) string(16) "get_called_class" float(0)
Output for 5.5.13
string(15) "debug_backtrace" float(0.010794878005981) string(16) "get_called_class" float(0)
Output for 5.5.12
string(15) "debug_backtrace" float(0.01171088218689) string(16) "get_called_class" float(0)
Output for 5.5.11
string(15) "debug_backtrace" float(0.013902902603149) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.10
string(15) "debug_backtrace" float(0.013050079345703) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.5.9
string(15) "debug_backtrace" float(0.010036945343018) string(16) "get_called_class" float(0)
Output for 5.5.8
string(15) "debug_backtrace" float(0.012640953063965) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.7
string(15) "debug_backtrace" float(0.01161789894104) string(16) "get_called_class" float(0)
Output for 5.5.6
string(15) "debug_backtrace" float(0.0096149444580078) string(16) "get_called_class" float(0)
Output for 5.5.5
string(15) "debug_backtrace" float(0.0096440315246582) string(16) "get_called_class" float(0)
Output for 5.5.4
string(15) "debug_backtrace" float(0.0094799995422363) string(16) "get_called_class" float(0)
Output for 5.5.3
string(15) "debug_backtrace" float(0.0095040798187256) string(16) "get_called_class" float(0)
Output for 5.5.2
string(15) "debug_backtrace" float(0.0095479488372803) string(16) "get_called_class" float(0)
Output for 5.5.1
string(15) "debug_backtrace" float(0.0096480846405029) string(16) "get_called_class" float(0)
Output for 5.5.0
string(15) "debug_backtrace" float(0.010280132293701) string(16) "get_called_class" float(0)
Output for 5.4.45
string(15) "debug_backtrace" float(0.013971090316772) string(16) "get_called_class" float(0)
Output for 5.4.44
string(15) "debug_backtrace" float(0.014410018920898) string(16) "get_called_class" float(0)
Output for 5.4.43
string(15) "debug_backtrace" float(0.013251066207886) string(16) "get_called_class" float(0)
Output for 5.4.42
string(15) "debug_backtrace" float(0.01108193397522) string(16) "get_called_class" float(0)
Output for 5.4.41
string(15) "debug_backtrace" float(0.012283086776733) string(16) "get_called_class" float(0)
Output for 5.4.40
string(15) "debug_backtrace" float(0.014758110046387) string(16) "get_called_class" float(0)
Output for 5.4.39
string(15) "debug_backtrace" float(0.013232946395874) string(16) "get_called_class" float(0)
Output for 5.4.38
string(15) "debug_backtrace" float(0.015661001205444) string(16) "get_called_class" float(0)
Output for 5.4.37
string(15) "debug_backtrace" float(0.015020132064819) string(16) "get_called_class" float(0)
Output for 5.4.36
string(15) "debug_backtrace" float(0.0097570419311523) string(16) "get_called_class" float(0)
Output for 5.4.35
string(15) "debug_backtrace" float(0.014991044998169) string(16) "get_called_class" float(0)
Output for 5.4.34
string(15) "debug_backtrace" float(0.014949083328247) string(16) "get_called_class" float(0)
Output for 5.4.32
string(15) "debug_backtrace" float(0.015494823455811) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.31
string(15) "debug_backtrace" float(0.012731790542603) string(16) "get_called_class" float(0)
Output for 5.4.30
string(15) "debug_backtrace" float(0.015444993972778) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.29
string(15) "debug_backtrace" float(0.015328884124756) string(16) "get_called_class" float(0)
Output for 5.4.28
string(15) "debug_backtrace" float(0.014688014984131) string(16) "get_called_class" float(0)
Output for 5.4.27
string(15) "debug_backtrace" float(0.013864994049072) string(16) "get_called_class" float(0)
Output for 5.4.26
string(15) "debug_backtrace" float(0.014754056930542) string(16) "get_called_class" float(0)
Output for 5.4.25
string(15) "debug_backtrace" float(0.014874219894409) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.24
string(15) "debug_backtrace" float(0.012580871582031) string(16) "get_called_class" float(0)
Output for 5.4.23
string(15) "debug_backtrace" float(0.0094819068908691) string(16) "get_called_class" float(0)
Output for 5.4.22
string(15) "debug_backtrace" float(0.011388063430786) string(16) "get_called_class" float(0)
Output for 5.4.21
string(15) "debug_backtrace" float(0.0090677738189697) string(16) "get_called_class" float(0)
Output for 5.4.20
string(15) "debug_backtrace" float(0.008418083190918) string(16) "get_called_class" float(0)
Output for 5.4.19
string(15) "debug_backtrace" float(0.0095019340515137) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.18
string(15) "debug_backtrace" float(0.0102219581604) string(16) "get_called_class" float(0)
Output for 5.4.17
string(15) "debug_backtrace" float(0.0094470977783203) string(16) "get_called_class" float(0)
Output for 5.4.16
string(15) "debug_backtrace" float(0.013378858566284) string(16) "get_called_class" float(0)
Output for 5.4.15
string(15) "debug_backtrace" float(0.010297060012817) string(16) "get_called_class" float(0)
Output for 5.4.14
string(15) "debug_backtrace" float(0.013236045837402) string(16) "get_called_class" float(0)
Output for 5.4.13
string(15) "debug_backtrace" float(0.0095710754394531) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.12
string(15) "debug_backtrace" float(0.010987043380737) string(16) "get_called_class" float(0)
Output for 5.4.11
string(15) "debug_backtrace" float(0.0091111660003662) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.10
string(15) "debug_backtrace" float(0.0091791152954102) string(16) "get_called_class" float(0)
Output for 5.4.9
string(15) "debug_backtrace" float(0.012382030487061) string(16) "get_called_class" float(0)
Output for 5.4.8
string(15) "debug_backtrace" float(0.0093309879302979) string(16) "get_called_class" float(0)
Output for 5.4.7
string(15) "debug_backtrace" float(0.010619163513184) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.6
string(15) "debug_backtrace" float(0.0093080997467041) string(16) "get_called_class" float(0)
Output for 5.4.5
string(15) "debug_backtrace" float(0.0093121528625488) string(16) "get_called_class" float(0)
Output for 5.4.4
string(15) "debug_backtrace" float(0.0095329284667969) string(16) "get_called_class" float(0)
Output for 5.4.3
string(15) "debug_backtrace" float(0.0093600749969482) string(16) "get_called_class" float(0)
Output for 5.4.2
string(15) "debug_backtrace" float(0.0096359252929688) string(16) "get_called_class" float(0)
Output for 5.4.1
string(15) "debug_backtrace" float(0.011543989181519) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.0
string(15) "debug_backtrace" float(0.0097839832305908) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.2.7 - 5.3.29
Output for 4.3.0 - 5.2.6
Notice: Use of undefined constant PHP_VERSION_ID - assumed 'PHP_VERSION_ID' in /in/OOqJJ on line 3