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(); } var_dump('debug_backtrace full', microtime(true) - $start); } } $foo = new Foo; $foo->recurseBenchCallerContex(1000, 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.3.10.0140.00716.36
7.3.00.0020.01016.24
7.2.130.0090.01216.66
7.2.120.0130.00616.55
7.2.110.0180.00016.61
7.2.100.0070.00716.62
7.2.90.0080.00816.61
7.2.80.0040.01116.59
7.2.70.0000.01216.76
7.2.60.0130.00416.43
7.2.50.0080.01217.15
7.2.40.0130.00316.53
7.2.30.0090.00616.47
7.2.20.0170.00316.39
7.2.10.0120.01616.75
7.2.00.0060.00818.09
7.1.250.0000.01515.18
7.1.70.0030.00617.36
7.1.60.0100.01019.46
7.1.50.0040.00717.11
7.1.00.0100.07022.31
7.0.200.0040.00416.64
7.0.140.0030.07322.00
7.0.60.0170.07019.91
7.0.50.0030.08318.05
7.0.40.0070.04320.11
7.0.30.0270.05720.16
7.0.20.0300.04320.16
7.0.10.0030.06320.12
7.0.00.0130.04320.30
5.6.280.0030.07320.98
5.6.210.0030.07720.80
5.6.200.0130.08018.27
5.6.190.0130.07720.67
5.6.180.0330.06020.39
5.6.170.0270.05720.55
5.6.160.0070.04320.43
5.6.150.0200.07318.28
5.6.140.0100.08018.15
5.6.130.0070.05318.25
5.6.120.0170.07721.24
5.6.110.0030.09021.08
5.6.100.0000.09021.12
5.6.90.0170.08721.10
5.6.80.0100.04720.51
5.5.350.0370.06720.48
5.5.340.0170.04718.00
5.5.330.0030.04320.34
5.5.320.0270.04720.27
5.5.310.0270.06320.34
5.5.300.0030.08317.96
5.5.290.0200.04018.08
5.5.280.0130.08720.98
5.5.270.0100.07720.99
5.5.260.0000.06320.89
5.5.250.0130.06720.68
5.5.240.0070.05020.17
5.4.450.0100.05319.46
5.4.440.0430.04019.63
5.4.430.0270.04319.20
5.4.420.0130.04719.38
5.4.410.0370.03319.27
5.4.400.0330.04319.07
5.4.390.0070.04319.22
5.4.380.0400.05018.86
5.4.370.0370.05718.70
5.4.360.0370.04718.86
5.4.350.0530.07018.78
5.4.340.0330.05318.85
5.4.320.0050.04012.63
5.4.310.0080.03712.62
5.4.300.0040.04012.62
5.4.290.0050.04012.62
5.4.280.0070.03812.52
5.4.270.0080.04812.52
5.4.260.0090.03712.52
5.4.250.0110.04512.52
5.4.240.0090.04012.52
5.4.230.0070.04112.51
5.4.220.0050.04212.52
5.4.210.0090.03812.52
5.4.200.0090.03712.51
5.4.190.0120.03112.51
5.4.180.0070.03712.51
5.4.170.0050.03912.52
5.4.160.0080.03612.51
5.4.150.0060.03812.52
5.4.140.0070.03912.20
5.4.130.0090.04412.18
5.4.120.0080.03912.14
5.4.110.0070.03612.14
5.4.100.0110.03212.14
5.4.90.0050.04012.14
5.4.80.0050.03912.14
5.4.70.0070.03512.13
5.4.60.0060.03712.13
5.4.50.0040.04512.13
5.4.40.0050.04212.13
5.4.30.0080.03612.12
5.4.20.0060.03612.12
5.4.10.0070.03512.12
5.4.00.0090.03611.61
5.3.290.0080.04112.80
5.3.280.0090.03612.71
5.3.270.0060.04512.73
5.3.260.0070.04412.72
5.3.250.0030.04012.72
5.3.240.0080.03512.72
5.3.230.0080.03612.71
5.3.220.0090.03812.68
5.3.210.0070.03812.68
5.3.200.0030.04012.68
5.3.190.0080.03612.68
5.3.180.0060.03512.67
5.3.170.0040.03812.66
5.3.160.0080.03912.67
5.3.150.0040.04012.68
5.3.140.0100.03212.66
5.3.130.0060.03912.66
5.3.120.0090.03612.65
5.3.110.0100.04812.66
5.3.100.0060.03912.12
5.3.90.0070.03612.10
5.3.80.0040.04212.09
5.3.70.0090.03312.09
5.3.60.0040.03812.07
5.3.50.0060.03812.02
5.3.40.0090.03712.02
5.3.30.0060.03611.98
5.3.20.0060.03511.76
5.3.10.0070.03911.73
5.3.00.0050.04111.71
5.2.170.0060.0349.22
5.2.160.0090.0269.22
5.2.150.0060.0299.21
5.2.140.0040.0319.21
5.2.130.0050.0289.18
5.2.120.0030.0309.18
5.2.110.0060.0289.19
5.2.100.0060.0279.18
5.2.90.0050.0299.18
5.2.80.0080.0269.17
5.2.70.0070.0289.18
5.2.60.0040.0329.13
5.2.50.0050.0309.09
5.2.40.0080.0349.07
5.2.30.0050.0299.05
5.2.20.0050.0279.03
5.2.10.0020.0308.94
5.2.00.0040.0298.80
5.1.60.0050.0268.09
5.1.50.0040.0258.09
5.1.40.0050.0238.06
5.1.30.0030.0278.42
5.1.20.0040.0288.45
5.1.10.0060.0258.18
5.1.00.0070.0298.18
5.0.50.0020.0246.65
5.0.40.0050.0186.52
5.0.30.0030.0316.33
5.0.20.0040.0196.29
5.0.10.0040.0196.27
5.0.00.0030.0316.27
4.4.90.0020.0174.78
4.4.80.0020.0164.76
4.4.70.0060.0124.76
4.4.60.0030.0154.76
4.4.50.0040.0144.77
4.4.40.0030.0254.71
4.4.30.0010.0184.76
4.4.20.0060.0144.84
4.4.10.0040.0144.85
4.4.00.0020.0264.76
4.3.110.0010.0184.67
4.3.100.0030.0144.66
4.3.90.0030.0144.63
4.3.80.0050.0264.59
4.3.70.0010.0174.63
4.3.60.0040.0134.63
4.3.50.0060.0194.63
4.3.40.0070.0264.54
4.3.30.0010.0173.32
4.3.20.0020.0163.30
4.3.10.0020.0163.26
4.3.00.0000.01318.56

preferences:
40.57 ms | 400 KiB | 5 Q