3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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.4.0
string(15) "debug_backtrace" float(0.005033016204834) string(16) "get_called_class" float(0)
Output for 7.3.12
string(15) "debug_backtrace" float(0.0052828788757324) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 7.3.11
string(15) "debug_backtrace" float(0.0053119659423828) string(16) "get_called_class" float(0)
Output for 7.3.10
string(15) "debug_backtrace" float(0.003471851348877) string(16) "get_called_class" float(0)
Output for 7.3.9
string(15) "debug_backtrace" float(0.0034129619598389) string(16) "get_called_class" float(0)
Output for 7.3.8
string(15) "debug_backtrace" float(0.003338098526001) string(16) "get_called_class" float(0)
Output for 7.3.7
string(15) "debug_backtrace" float(0.003554105758667) string(16) "get_called_class" float(0)
Output for 7.3.6
string(15) "debug_backtrace" float(0.0035741329193115) string(16) "get_called_class" float(0)
Output for 7.3.5
string(15) "debug_backtrace" float(0.0033650398254395) string(16) "get_called_class" float(0)
Output for 7.3.4
string(15) "debug_backtrace" float(0.0033450126647949) string(16) "get_called_class" float(0)
Output for 7.3.3
string(15) "debug_backtrace" float(0.0054271221160889) string(16) "get_called_class" float(0)
Output for 7.3.2
string(15) "debug_backtrace" float(0.0050549507141113) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 7.3.1
string(15) "debug_backtrace" float(0.0043220520019531) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.3.0
string(15) "debug_backtrace" float(0.0038700103759766) string(16) "get_called_class" float(0)
Output for 7.2.25
string(15) "debug_backtrace" float(0.0050649642944336) string(16) "get_called_class" float(0)
Output for 7.2.24
string(15) "debug_backtrace" float(0.0060739517211914) string(16) "get_called_class" float(0)
Output for 7.2.23
string(15) "debug_backtrace" float(0.006134033203125) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.2.22
string(15) "debug_backtrace" float(0.0038490295410156) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.2.21
string(15) "debug_backtrace" float(0.0058450698852539) string(16) "get_called_class" float(0)
Output for 7.2.20
string(15) "debug_backtrace" float(0.0038750171661377) string(16) "get_called_class" float(0)
Output for 7.2.19
string(15) "debug_backtrace" float(0.0037879943847656) string(16) "get_called_class" float(0)
Output for 7.2.18
string(15) "debug_backtrace" float(0.003864049911499) string(16) "get_called_class" float(0)
Output for 7.2.17
string(15) "debug_backtrace" float(0.003803014755249) string(16) "get_called_class" float(0)
Output for 7.2.0
string(15) "debug_backtrace" float(0.0034878253936768) string(16) "get_called_class" float(0)
Output for 7.1.33
string(15) "debug_backtrace" float(0.0062859058380127) string(16) "get_called_class" float(0)
Output for 7.1.32
string(15) "debug_backtrace" float(0.0049500465393066) string(16) "get_called_class" float(0)
Output for 7.1.31
string(15) "debug_backtrace" float(0.0078001022338867) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.1.30
string(15) "debug_backtrace" float(0.0058739185333252) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.1.29
string(15) "debug_backtrace" float(0.0063378810882568) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.1.28
string(15) "debug_backtrace" float(0.0051560401916504) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.1.27
string(15) "debug_backtrace" float(0.005195140838623) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.1.26
string(15) "debug_backtrace" float(0.0050539970397949) string(16) "get_called_class" float(0)
Output for 7.1.7
string(15) "debug_backtrace" float(0.003140926361084) string(16) "get_called_class" float(0)
Output for 7.1.6
string(15) "debug_backtrace" float(0.0051300525665283) string(16) "get_called_class" float(0)
Output for 7.1.5
string(15) "debug_backtrace" float(0.006080150604248) string(16) "get_called_class" float(0)
Output for 7.1.0
string(15) "debug_backtrace" float(0.0049190521240234) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.0.20
string(15) "debug_backtrace" float(0.012619018554688) string(16) "get_called_class" float(0)
Output for 7.0.14
string(15) "debug_backtrace" float(0.0090720653533936) string(16) "get_called_class" float(0)
Output for 7.0.6
string(15) "debug_backtrace" float(0.0084471702575684) string(16) "get_called_class" float(0)
Output for 7.0.5
string(15) "debug_backtrace" float(0.0080690383911133) string(16) "get_called_class" float(0)
Output for 7.0.4
string(15) "debug_backtrace" float(0.0074620246887207) string(16) "get_called_class" float(0)
Output for 7.0.3
string(15) "debug_backtrace" float(0.0054459571838379) string(16) "get_called_class" float(0)
Output for 7.0.2
string(15) "debug_backtrace" float(0.006152868270874) string(16) "get_called_class" float(0)
Output for 7.0.1
string(15) "debug_backtrace" float(0.0052700042724609) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 7.0.0
string(15) "debug_backtrace" float(0.0079739093780518) string(16) "get_called_class" float(0)
Output for 5.6.21
string(15) "debug_backtrace" float(0.010786056518555) string(16) "get_called_class" float(0)
Output for 5.6.20
string(15) "debug_backtrace" float(0.015155076980591) string(16) "get_called_class" float(0)
Output for 5.6.19
string(15) "debug_backtrace" float(0.011628150939941) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.18
string(15) "debug_backtrace" float(0.012879848480225) string(16) "get_called_class" float(0)
Output for 5.6.17
string(15) "debug_backtrace" float(0.0092840194702148) string(16) "get_called_class" float(0)
Output for 5.6.16
string(15) "debug_backtrace" float(0.009289026260376) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.15
string(15) "debug_backtrace" float(0.0092840194702148) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.6.14
string(15) "debug_backtrace" float(0.013742923736572) string(16) "get_called_class" float(0)
Output for 5.6.13
string(15) "debug_backtrace" float(0.012325048446655) string(16) "get_called_class" float(0)
Output for 5.6.12
string(15) "debug_backtrace" float(0.009207010269165) string(16) "get_called_class" float(0)
Output for 5.6.11
string(15) "debug_backtrace" float(0.015168905258179) string(16) "get_called_class" float(0)
Output for 5.6.10
string(15) "debug_backtrace" float(0.013808965682983) string(16) "get_called_class" float(0)
Output for 5.6.9
string(15) "debug_backtrace" float(0.013976097106934) string(16) "get_called_class" float(0)
Output for 5.6.8
string(15) "debug_backtrace" float(0.0096487998962402) string(16) "get_called_class" float(0)
Output for 5.5.35
string(15) "debug_backtrace" float(0.012778997421265) string(16) "get_called_class" float(0)
Output for 5.5.34
string(15) "debug_backtrace" float(0.013129949569702) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.33
string(15) "debug_backtrace" float(0.014662981033325) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.5.32
string(15) "debug_backtrace" float(0.013952970504761) string(16) "get_called_class" float(0)
Output for 5.5.31
string(15) "debug_backtrace" float(0.012377977371216) string(16) "get_called_class" float(0)
Output for 5.5.30
string(15) "debug_backtrace" float(0.010797023773193) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.29
string(15) "debug_backtrace" float(0.015274047851562) string(16) "get_called_class" float(0)
Output for 5.5.28
string(15) "debug_backtrace" float(0.014509201049805) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.5.27
string(15) "debug_backtrace" float(0.012155055999756) string(16) "get_called_class" float(0)
Output for 5.5.26
string(15) "debug_backtrace" float(0.017774820327759) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.5.25
string(15) "debug_backtrace" float(0.0099577903747559) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.5.24
string(15) "debug_backtrace" float(0.013747930526733) string(16) "get_called_class" float(0)
Output for 5.4.45
string(15) "debug_backtrace" float(0.0093338489532471) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.44
string(15) "debug_backtrace" float(0.0094668865203857) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.43
string(15) "debug_backtrace" float(0.013139963150024) string(16) "get_called_class" float(0)
Output for 5.4.42
string(15) "debug_backtrace" float(0.0092170238494873) string(16) "get_called_class" float(0)
Output for 5.4.41
string(15) "debug_backtrace" float(0.0093321800231934) string(16) "get_called_class" float(0)
Output for 5.4.40
string(15) "debug_backtrace" float(0.0094368457794189) string(16) "get_called_class" float(0)
Output for 5.4.39
string(15) "debug_backtrace" float(0.0094559192657471) string(16) "get_called_class" float(0)
Output for 5.4.38
string(15) "debug_backtrace" float(0.010918140411377) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.37
string(15) "debug_backtrace" float(0.0091080665588379) string(16) "get_called_class" float(0)
Output for 5.4.36
string(15) "debug_backtrace" float(0.0094699859619141) string(16) "get_called_class" float(0)
Output for 5.4.35
string(15) "debug_backtrace" float(0.013909101486206) string(16) "get_called_class" float(0)
Output for 5.4.34
string(15) "debug_backtrace" float(0.0091040134429932) string(16) "get_called_class" float(0)
Output for 5.4.32
string(15) "debug_backtrace" float(0.0092439651489258) string(16) "get_called_class" float(0)
Output for 5.4.31
string(15) "debug_backtrace" float(0.0094201564788818) string(16) "get_called_class" float(0)
Output for 5.4.30
string(15) "debug_backtrace" float(0.0093111991882324) string(16) "get_called_class" float(0)
Output for 5.4.29
string(15) "debug_backtrace" float(0.009627103805542) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.4.28
string(15) "debug_backtrace" float(0.0098769664764404) string(16) "get_called_class" float(0)
Output for 5.4.27
string(15) "debug_backtrace" float(0.013248920440674) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.4.26
string(15) "debug_backtrace" float(0.014157056808472) string(16) "get_called_class" float(0)
Output for 5.4.25
string(15) "debug_backtrace" float(0.013132095336914) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.24
string(15) "debug_backtrace" float(0.0092787742614746) string(16) "get_called_class" float(0)
Output for 5.4.23
string(15) "debug_backtrace" float(0.0091590881347656) string(16) "get_called_class" float(0)
Output for 5.4.22
string(15) "debug_backtrace" float(0.011898040771484) string(16) "get_called_class" float(0)
Output for 5.4.21
string(15) "debug_backtrace" float(0.0091350078582764) string(16) "get_called_class" float(0)
Output for 5.4.20
string(15) "debug_backtrace" float(0.0094051361083984) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.19
string(15) "debug_backtrace" float(0.0093190670013428) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.18
string(15) "debug_backtrace" float(0.012554168701172) string(16) "get_called_class" float(0)
Output for 5.4.17
string(15) "debug_backtrace" float(0.0097329616546631) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.16
string(15) "debug_backtrace" float(0.0095970630645752) string(16) "get_called_class" float(0)
Output for 5.4.15
string(15) "debug_backtrace" float(0.0092489719390869) string(16) "get_called_class" float(0)
Output for 5.4.14
string(15) "debug_backtrace" float(0.0092670917510986) string(16) "get_called_class" float(0)
Output for 5.4.13
string(15) "debug_backtrace" float(0.011523962020874) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.12
string(15) "debug_backtrace" float(0.0095109939575195) string(16) "get_called_class" float(0)
Output for 5.4.11
string(15) "debug_backtrace" float(0.0093798637390137) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.10
string(15) "debug_backtrace" float(0.0094749927520752) string(16) "get_called_class" float(0)
Output for 5.4.9
string(15) "debug_backtrace" float(0.0093240737915039) string(16) "get_called_class" float(0)
Output for 5.4.8
string(15) "debug_backtrace" float(0.0096468925476074) string(16) "get_called_class" float(0)
Output for 5.4.7
string(15) "debug_backtrace" float(0.0094590187072754) string(16) "get_called_class" float(0)
Output for 5.4.6
string(15) "debug_backtrace" float(0.009005069732666) string(16) "get_called_class" float(1.1920928955078E-6)
Output for 5.4.5
string(15) "debug_backtrace" float(0.0091569423675537) string(16) "get_called_class" float(0)
Output for 5.4.4
string(15) "debug_backtrace" float(0.0094010829925537) string(16) "get_called_class" float(0)
Output for 5.4.3
string(15) "debug_backtrace" float(0.013044118881226) string(16) "get_called_class" float(0)
Output for 5.4.2
string(15) "debug_backtrace" float(0.0092720985412598) string(16) "get_called_class" float(9.5367431640625E-7)
Output for 5.4.1
string(15) "debug_backtrace" float(0.0094640254974365) string(16) "get_called_class" float(0)
Output for 5.4.0
string(15) "debug_backtrace" float(0.0096061229705811) string(16) "get_called_class" float(9.5367431640625E-7)

preferences:
127.51 ms | 401 KiB | 121 Q