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); $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(); } var_dump('debug_backtrace full', microtime(true) - $start); } } $foo = new Foo; $foo->recurseBenchCallerContex(10000, 100);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.00.0070.11019.37
7.1.70.0000.10117.21
7.1.60.0100.14219.46
7.1.50.0100.14717.00
7.1.00.0070.19322.43
7.0.200.0030.23216.76
7.0.140.0100.29721.98
7.0.60.0030.26019.94
7.0.50.0000.29317.86
7.0.40.0030.29720.11
7.0.30.0270.27020.10
7.0.20.0300.21720.08
7.0.10.0170.28320.16
7.0.00.0100.28720.25
5.6.280.0130.49321.04
5.6.210.0030.48721.00
5.6.200.0030.45018.50
5.6.190.0100.39320.63
5.6.180.0400.45720.75
5.6.170.0230.45720.58
5.6.160.0030.41320.61
5.6.150.0100.57718.25
5.6.140.0100.44718.43
5.6.130.0100.47018.39
5.6.120.0130.44321.38
5.6.110.0200.48321.26
5.6.100.0130.46721.28
5.6.90.0030.47321.23
5.6.80.0000.39320.63
5.5.350.0200.46720.64
5.5.340.0030.48718.18
5.5.330.0100.43320.41
5.5.320.0230.45320.21
5.5.310.0130.39320.46
5.5.300.0100.44018.21
5.5.290.0030.45718.17
5.5.280.0030.40321.04
5.5.270.0070.44720.91
5.5.260.0070.46321.15
5.5.250.0270.41020.95
5.5.240.0000.54320.28
5.4.450.0300.65719.65
5.4.440.0200.64719.46
5.4.430.0070.55319.73
5.4.420.0470.64319.60
5.4.410.0200.53319.36
5.4.400.0270.53719.28
5.4.390.0100.46319.14
5.4.380.0430.72019.07
5.4.370.0330.64718.96
5.4.360.0330.72318.94
5.4.350.0430.71319.07
5.4.340.0370.70719.09
5.4.320.0100.49212.85
5.4.310.0080.49912.85
5.4.300.0090.50812.86
5.4.290.0130.50712.85
5.4.280.0030.50612.75
5.4.270.0090.49812.75
5.4.260.0060.49712.75
5.4.250.0100.49312.75
5.4.240.0100.58312.75
5.4.230.0120.48612.74
5.4.220.0090.48512.74
5.4.210.0080.48512.74
5.4.200.0080.51412.74
5.4.190.0070.50612.74
5.4.180.0090.53012.74
5.4.170.0090.49312.75
5.4.160.0040.51212.75
5.4.150.0120.48012.74
5.4.140.0050.51912.42
5.4.130.0080.51712.41
5.4.120.0100.51512.37
5.4.110.0090.52012.37
5.4.100.0040.51112.37
5.4.90.0080.51212.37
5.4.80.0090.50412.37
5.4.70.0050.52612.36
5.4.60.0120.51612.36
5.4.50.0080.51812.37
5.4.40.0070.51612.35
5.4.30.0100.53612.35
5.4.20.0050.53912.34
5.4.10.0110.52712.35
5.4.00.0060.51811.84
5.3.290.0070.04512.80
5.3.280.0070.04212.71
5.3.270.0060.03812.73
5.3.260.0050.04012.72
5.3.250.0110.03312.72
5.3.240.0100.03812.72
5.3.230.0100.04912.71
5.3.220.0080.05012.68
5.3.210.0050.04512.68
5.3.200.0080.03412.68
5.3.190.0060.03812.67
5.3.180.0080.03512.68
5.3.170.0070.04112.67
5.3.160.0050.04112.67
5.3.150.0050.03712.67
5.3.140.0120.03512.66
5.3.130.0060.04312.65
5.3.120.0080.04312.66
5.3.110.0100.03712.66
5.3.100.0090.03412.12
5.3.90.0060.03712.10
5.3.80.0040.03712.09
5.3.70.0070.03712.09
5.3.60.0070.03812.07
5.3.50.0100.03512.02
5.3.40.0080.04112.02
5.3.30.0060.03711.98
5.3.20.0050.03711.76
5.3.10.0060.03511.73
5.3.00.0080.03311.71
5.2.170.0080.0319.22
5.2.160.0110.0299.21
5.2.150.0100.0339.22
5.2.140.0060.0309.21
5.2.130.0030.0359.18
5.2.120.0090.0299.18
5.2.110.0050.0329.18
5.2.100.0030.0299.18
5.2.90.0070.0279.18
5.2.80.0060.0379.18
5.2.70.0060.0389.18
5.2.60.0060.0329.13
5.2.50.0050.0309.10
5.2.40.0060.0299.07
5.2.30.0050.0309.05
5.2.20.0030.0309.04
5.2.10.0030.0318.94
5.2.00.0030.0318.81
5.1.60.0050.0248.09
5.1.50.0030.0268.09
5.1.40.0040.0248.06
5.1.30.0040.0268.42
5.1.20.0050.0268.45
5.1.10.0040.0268.17
5.1.00.0020.0288.17
5.0.50.0040.0216.66
5.0.40.0030.0246.52
5.0.30.0050.0306.33
5.0.20.0040.0196.29
5.0.10.0050.0196.27
5.0.00.0020.0326.27
4.4.90.0020.0164.77
4.4.80.0060.0124.75
4.4.70.0030.0154.75
4.4.60.0030.0154.75
4.4.50.0030.0154.77
4.4.40.0040.0244.71
4.4.30.0020.0194.76
4.4.20.0040.0274.84
4.4.10.0060.0194.85
4.4.00.0070.0324.76
4.3.110.0050.0214.66
4.3.100.0060.0194.66
4.3.90.0060.0184.63
4.3.80.0020.0334.58
4.3.70.0040.0194.63
4.3.60.0040.0204.63
4.3.50.0050.0204.63
4.3.40.0050.0234.53
4.3.30.0010.0193.32
4.3.20.0010.0203.30
4.3.10.0040.0143.27
4.3.00.0000.01718.56

preferences:
36.45 ms | 400 KiB | 5 Q