3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(PHP_VERSION_ID); if(PHP_VERSION_ID <= 504000) { 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(); } $start = microtime(true); var_dump('get_called_class', 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.0060.00919.29
7.1.70.0080.00417.01
7.1.60.0040.01619.46
7.1.50.0030.01716.89
7.1.00.0130.06322.44
7.0.200.0000.00716.51
7.0.140.0070.07022.04
7.0.60.0070.07319.92
7.0.50.0100.04017.85
7.0.40.0000.05320.18
7.0.30.0300.04720.20
7.0.20.0330.06320.33
7.0.10.0100.07320.12
7.0.00.0070.05720.12
5.6.280.0000.07720.79
5.6.210.0130.08020.65
5.6.200.0100.07018.22
5.6.190.0070.05320.34
5.6.180.0330.04320.58
5.6.170.0200.08720.46
5.6.160.0130.07720.54
5.6.150.0000.07318.18
5.6.140.0070.05018.14
5.6.130.0200.07018.15
5.6.120.0070.04021.04
5.6.110.0070.08021.13
5.6.100.0070.08020.96
5.6.90.0070.04020.98
5.6.80.0030.04020.43
5.5.350.0230.07720.34
5.5.340.0130.06317.99
5.5.330.0030.08720.23
5.5.320.0070.05020.21
5.5.310.0270.07320.34
5.5.300.0070.03717.93
5.5.290.0100.04717.99
5.5.280.0070.06720.80
5.5.270.0170.07320.88
5.5.260.0070.04020.98
5.5.250.0070.03720.62
5.5.240.0030.07320.07
5.4.450.0400.04019.32
5.4.440.0170.04719.20
5.4.430.0130.04319.16
5.4.420.0430.04319.45
5.4.410.0070.04319.42
5.4.400.0430.03719.32
5.4.390.0230.03019.22
5.4.380.0330.06018.60
5.4.370.0530.07018.75
5.4.360.0370.06018.61
5.4.350.0370.06318.75
5.4.340.0370.05318.57
5.4.320.0090.03812.51
5.4.310.0080.04212.50
5.4.300.0060.03712.50
5.4.290.0070.03712.50
5.4.280.0090.03612.40
5.4.270.0060.03812.40
5.4.260.0050.04712.39
5.4.250.0040.03912.40
5.4.240.0080.03912.40
5.4.230.0070.03712.39
5.4.220.0030.04012.39
5.4.210.0080.03612.39
5.4.200.0050.03912.39
5.4.190.0080.04512.38
5.4.180.0080.04012.39
5.4.170.0050.04012.39
5.4.160.0080.03412.40
5.4.150.0060.03612.39
5.4.140.0070.03612.07
5.4.130.0090.03812.06
5.4.120.0080.03412.02
5.4.110.0070.03512.01
5.4.100.0060.04012.02
5.4.90.0040.03912.02
5.4.80.0040.04012.02
5.4.70.0080.03312.01
5.4.60.0110.03212.01
5.4.50.0080.03312.01
5.4.40.0080.04012.00
5.4.30.0070.03412.00
5.4.20.0030.03711.99
5.4.10.0070.03412.00
5.4.00.0040.03611.48
5.3.290.0070.03912.80
5.3.280.0120.04512.71
5.3.270.0050.03912.72
5.3.260.0070.04112.72
5.3.250.0060.03912.72
5.3.240.0090.03912.72
5.3.230.0050.04012.71
5.3.220.0040.04512.68
5.3.210.0080.04912.68
5.3.200.0090.03412.68
5.3.190.0060.03712.68
5.3.180.0060.03612.67
5.3.170.0060.03712.66
5.3.160.0070.03612.68
5.3.150.0080.03912.67
5.3.140.0110.03812.66
5.3.130.0110.03812.66
5.3.120.0120.03512.66
5.3.110.0080.04812.66
5.3.100.0050.04412.11
5.3.90.0070.04612.10
5.3.80.0090.03412.09
5.3.70.0090.04012.09
5.3.60.0110.04212.08
5.3.50.0050.03912.02
5.3.40.0090.03712.03
5.3.30.0090.03411.98
5.3.20.0050.04111.77
5.3.10.0110.03111.73
5.3.00.0070.04011.71
5.2.170.0050.0329.23
5.2.160.0050.0319.23
5.2.150.0050.0319.23
5.2.140.0050.0329.23
5.2.130.0060.0299.19
5.2.120.0090.0279.19
5.2.110.0050.0309.20
5.2.100.0080.0279.19
5.2.90.0070.0349.20
5.2.80.0040.0369.18
5.2.70.0060.0389.19
5.2.60.0060.0389.14
5.2.50.0070.0439.11
5.2.40.0060.0279.09
5.2.30.0040.0319.06
5.2.20.0070.0269.05
5.2.10.0050.0298.95
5.2.00.0080.0268.82
5.1.60.0050.0268.10
5.1.50.0020.0278.10
5.1.40.0050.0248.08
5.1.30.0040.0268.43
5.1.20.0040.0278.45
5.1.10.0040.0278.17
5.1.00.0050.0248.17
5.0.50.0050.0196.66
5.0.40.0020.0216.52
5.0.30.0020.0326.33
5.0.20.0070.0256.29
5.0.10.0000.0246.28
5.0.00.0030.0316.27
4.4.90.0030.0194.78
4.4.80.0040.0164.75
4.4.70.0040.0234.75
4.4.60.0030.0214.75
4.4.50.0040.0144.77
4.4.40.0030.0314.71
4.4.30.0020.0204.76
4.4.20.0050.0194.85
4.4.10.0070.0174.85
4.4.00.0030.0284.76
4.3.110.0050.0154.67
4.3.100.0050.0124.67
4.3.90.0040.0174.63
4.3.80.0030.0264.58
4.3.70.0020.0214.63
4.3.60.0040.0194.63
4.3.50.0030.0164.63
4.3.40.0030.0254.54
4.3.30.0030.0243.33
4.3.20.0040.0193.30
4.3.10.0020.0183.27
4.3.00.0070.01318.56

preferences:
39.74 ms | 401 KiB | 5 Q