3v4l.org

run code in 300+ PHP versions simultaneously
<?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(10000, 0);

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.0110.00619.32
7.1.70.0040.00417.16
7.1.60.0060.01819.46
7.1.50.0070.01717.19
7.1.00.0000.07722.24
7.0.200.0030.00616.66
7.0.140.0030.07722.21
7.0.60.0000.05319.86
7.0.50.0070.06017.85
7.0.40.0070.05719.99
7.0.30.0300.07319.97
7.0.20.0300.08019.95
7.0.10.0300.06319.97
7.0.00.0170.07319.96
5.6.280.0030.07721.00
5.6.210.0100.05720.65
5.6.200.0000.05318.09
5.6.190.0070.09020.38
5.6.180.3570.04020.45
5.6.170.0370.05020.43
5.6.160.0170.07720.39
5.6.150.0000.04318.15
5.6.140.0100.07718.11
5.6.130.0070.05718.19
5.6.120.0200.07320.99
5.6.110.0100.08721.12
5.6.100.0070.07721.08
5.6.90.0130.07321.13
5.6.80.0170.07020.43
5.6.70.4770.03320.36
5.5.350.0030.08720.45
5.5.340.0070.03717.95
5.5.330.0000.04720.01
5.5.320.0270.08019.98
5.5.310.0170.04720.12
5.5.300.0000.05017.95
5.5.290.0030.04317.95
5.5.280.0130.07720.69
5.5.270.0100.08320.86
5.5.260.0100.08320.65
5.5.250.0130.07720.64
5.5.240.0070.08020.37
5.4.450.0330.04719.33
5.4.440.0270.05019.50
5.4.430.0230.04719.14
5.4.420.0400.04719.36
5.4.410.0200.03719.23
5.4.400.0270.04718.82
5.4.390.0930.04318.93
5.4.380.0330.06718.77
5.4.370.0430.05718.58
5.4.360.0570.06018.73
5.4.350.0230.08018.46
5.4.340.0230.07018.74
5.4.320.0080.03712.51
5.4.310.0120.03612.50
5.4.300.0090.04012.50
5.4.290.0080.03912.50
5.4.280.0050.04012.40
5.4.270.0070.03812.40
5.4.260.0030.04212.40
5.4.250.0100.03612.39
5.4.240.0080.04312.40
5.4.230.0070.03912.39
5.4.220.0030.04112.39
5.4.210.0070.04312.39
5.4.200.0100.03712.39
5.4.190.0070.03912.39
5.4.180.0050.03912.38
5.4.170.0060.03712.40
5.4.160.0050.03712.39
5.4.150.0080.03512.39
5.4.140.0060.03912.07
5.4.130.0040.03812.06
5.4.120.0090.03812.02
5.4.110.0060.03712.02
5.4.100.0080.03412.02
5.4.90.0070.03712.02
5.4.80.0080.05512.02
5.4.70.0060.03712.01
5.4.60.0080.03512.01
5.4.50.0070.03612.01
5.4.40.0040.03912.00
5.4.30.0130.02912.00
5.4.20.0060.04512.00
5.4.10.0110.03912.00
5.4.00.0130.03611.48
5.3.290.0060.03712.80
5.3.280.0030.03912.71
5.3.270.0050.03912.72
5.3.260.0070.03712.72
5.3.250.0030.04312.72
5.3.240.0080.03512.72
5.3.230.0070.03612.71
5.3.220.0060.03712.68
5.3.210.0060.03812.68
5.3.200.0090.03312.68
5.3.190.0040.04012.68
5.3.180.0070.04012.68
5.3.170.0060.03812.67
5.3.160.0060.04412.67
5.3.150.0050.03712.68
5.3.140.0050.03612.66
5.3.130.0050.04512.65
5.3.120.0050.04312.66
5.3.110.0030.04112.66
5.3.100.0030.04012.13
5.3.90.0060.03612.11
5.3.80.0040.03712.10
5.3.70.0040.03612.10
5.3.60.0060.03412.08
5.3.50.0050.03712.03
5.3.40.0060.03512.03
5.3.30.0060.03711.99
5.3.20.0020.03711.77
5.3.10.0050.03411.73
5.3.00.0040.03911.72
5.2.170.0020.0339.23
5.2.160.0030.0359.22
5.2.150.0040.0299.23
5.2.140.0050.0309.22
5.2.130.0050.0289.18
5.2.120.0020.0309.18
5.2.110.0030.0309.19
5.2.100.0030.0299.18
5.2.90.0040.0289.18
5.2.80.0040.0299.18
5.2.70.0030.0319.18
5.2.60.0040.0309.13
5.2.50.0050.0299.09
5.2.40.0040.0289.07
5.2.30.0060.0279.05
5.2.20.0040.0289.04
5.2.10.0020.0308.95
5.2.00.0040.0288.81
5.1.60.0030.0238.09
5.1.50.0040.0238.09
5.1.40.0040.0238.07
5.1.30.0060.0248.42
5.1.20.0060.0278.44
5.1.10.0060.0298.16
5.1.00.0050.0248.17
5.0.50.0050.0216.65
5.0.40.0020.0196.51
5.0.30.0030.0306.32
5.0.20.0020.0206.28
5.0.10.0030.0196.27
5.0.00.0040.0296.26
4.4.90.0010.0164.77
4.4.80.0030.0144.76
4.4.70.0020.0164.75
4.4.60.0030.0154.75
4.4.50.0010.0174.77
4.4.40.0040.0234.71
4.4.30.0040.0154.76
4.4.20.0030.0154.84
4.4.10.0020.0164.84
4.4.00.0020.0264.76
4.3.110.0030.0154.67
4.3.100.0030.0144.67
4.3.90.0020.0154.63
4.3.80.0030.0234.59
4.3.70.0030.0144.63
4.3.60.0030.0144.63
4.3.50.0010.0164.63
4.3.40.0030.0234.54
4.3.30.0010.0163.30
4.3.20.0020.0163.28
4.3.10.0010.0163.24
4.3.00.0000.02018.56

preferences:
37.4 ms | 401 KiB | 5 Q