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(1000, 10);

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.00719.30
7.1.70.0060.01117.01
7.1.60.0160.00919.46
7.1.50.0190.00616.96
7.1.00.0000.07722.52
7.0.200.0070.00416.68
7.0.140.0130.06321.92
7.0.60.0100.07021.66
7.0.50.0000.04317.78
7.0.40.0070.04720.13
7.0.30.0300.06720.08
7.0.20.0200.04720.18
7.0.10.0030.04720.26
7.0.00.0030.08020.22
5.6.280.0000.08020.77
5.6.210.0000.09320.48
5.6.200.0170.03718.22
5.6.190.0100.08320.62
5.6.180.0230.07020.41
5.6.170.0370.07320.52
5.6.160.0070.08020.39
5.6.150.0070.07718.18
5.6.140.0030.05718.14
5.6.130.0070.03718.19
5.6.120.0030.04320.98
5.6.110.0030.07020.99
5.6.100.0100.04020.96
5.6.90.0200.07320.98
5.6.80.0070.06720.51
5.5.350.0370.07320.48
5.5.340.0130.07017.94
5.5.330.0100.05720.44
5.5.320.0170.06020.30
5.5.310.0370.06020.30
5.5.300.0000.08717.99
5.5.290.0070.05018.09
5.5.280.0000.06320.88
5.5.270.0070.08020.76
5.5.260.0030.04320.79
5.5.250.0000.07320.79
5.5.240.0030.08020.29
5.4.450.0170.04719.57
5.4.440.0170.05319.29
5.4.430.0370.05319.58
5.4.420.0200.04719.40
5.4.410.0270.04319.51
5.4.400.0400.05018.84
5.4.390.0700.04718.98
5.4.380.0400.07018.49
5.4.370.0300.07718.75
5.4.360.1130.07718.70
5.4.350.0530.07718.73
5.4.340.0330.05718.61
5.4.320.0050.03812.51
5.4.310.0040.04012.51
5.4.300.0060.03812.52
5.4.290.0050.04212.51
5.4.280.0050.03712.41
5.4.270.0040.03912.41
5.4.260.0050.04012.41
5.4.250.0070.03612.41
5.4.240.0080.04112.41
5.4.230.0030.04012.41
5.4.220.0060.03612.40
5.4.210.0060.03612.41
5.4.200.0040.03912.41
5.4.190.0050.03712.40
5.4.180.0050.03612.40
5.4.170.0020.04112.41
5.4.160.0020.04112.41
5.4.150.0070.04412.40
5.4.140.0060.04212.09
5.4.130.0050.04512.07
5.4.120.0070.03412.04
5.4.110.0090.04012.03
5.4.100.0060.04012.03
5.4.90.0060.04712.03
5.4.80.0080.03412.03
5.4.70.0100.03012.03
5.4.60.0020.03912.02
5.4.50.0080.04212.02
5.4.40.0070.03712.01
5.4.30.0030.03912.01
5.4.20.0040.03712.01
5.4.10.0040.04112.01
5.4.00.0080.03711.50
5.3.290.0090.03812.80
5.3.280.0060.03912.70
5.3.270.0120.04012.72
5.3.260.0100.03312.72
5.3.250.0050.04412.71
5.3.240.0060.03812.72
5.3.230.0030.04012.71
5.3.220.0100.03412.68
5.3.210.0040.04512.68
5.3.200.0110.03212.68
5.3.190.0120.03912.68
5.3.180.0100.04012.67
5.3.170.0120.03912.67
5.3.160.0020.04212.67
5.3.150.0070.03812.67
5.3.140.0090.03412.66
5.3.130.0040.04112.66
5.3.120.0040.04812.66
5.3.110.0070.03912.66
5.3.100.0100.03412.12
5.3.90.0050.03712.08
5.3.80.0050.03712.07
5.3.70.0050.03712.07
5.3.60.0070.03512.06
5.3.50.0040.03812.00
5.3.40.0100.04012.00
5.3.30.0060.03911.96
5.3.20.0100.04511.74
5.3.10.0090.04311.70
5.3.00.0080.03511.69
5.2.170.0080.0329.18
5.2.160.0070.0279.18
5.2.150.0080.0339.19
5.2.140.0070.0339.18
5.2.130.0050.0339.14
5.2.120.0070.0329.14
5.2.110.0060.0319.15
5.2.100.0040.0309.14
5.2.90.0050.0319.14
5.2.80.0050.0349.13
5.2.70.0060.0379.13
5.2.60.0070.0309.09
5.2.50.0090.0269.06
5.2.40.0060.0329.04
5.2.30.0070.0309.02
5.2.20.0470.05010.91
5.2.10.0400.04010.91
5.2.00.1230.04310.91
5.1.60.0230.03010.91
5.1.50.0200.03710.91
5.1.40.0230.04710.91
5.1.30.0230.03710.91
5.1.20.0230.03710.91
5.1.10.0230.03710.91
5.1.00.0270.04310.91
5.0.50.0130.03310.91
5.0.40.0070.04710.91
5.0.30.0200.04310.91
5.0.20.0400.02310.91
5.0.10.0300.03310.91
5.0.00.0170.04710.91
4.4.90.0130.02310.91
4.4.80.0870.02710.91
4.4.70.0100.03010.91
4.4.60.0070.03010.91
4.4.50.0130.02310.91
4.4.40.0130.03710.91
4.4.30.0230.01310.91
4.4.20.0100.02710.91
4.4.10.0130.03710.91
4.4.00.0100.04710.91
4.3.110.0230.02710.91
4.3.100.0800.04010.91
4.3.90.0230.02010.91
4.3.80.0130.03310.91
4.3.70.0130.03010.91
4.3.60.0200.02010.91
4.3.50.0200.02010.91
4.3.40.0170.04310.91
4.3.30.0130.03010.91
4.3.20.0170.02310.91
4.3.10.0100.02010.91
4.3.00.0070.01318.56

preferences:
37.58 ms | 400 KiB | 5 Q