3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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.4.00.0060.01215.03
7.3.120.0130.00414.73
7.3.110.0000.01814.48
7.3.100.0030.01514.67
7.3.90.0070.01014.73
7.3.80.0160.00014.48
7.3.70.0040.00814.71
7.3.60.0030.01014.51
7.3.50.0000.01114.80
7.3.40.0070.01114.51
7.3.30.0030.00914.81
7.3.20.0110.00416.60
7.3.10.0060.00916.34
7.3.00.0140.00016.35
7.2.250.0030.01415.00
7.2.240.0070.01414.75
7.2.230.0090.00614.85
7.2.220.0030.00715.01
7.2.210.0060.00614.51
7.2.200.0000.01814.55
7.2.190.0030.00614.78
7.2.180.0000.01414.89
7.2.170.0030.01314.96
7.1.330.0030.01015.90
7.1.320.0070.00815.86
7.1.310.0030.00915.43
7.1.300.0060.00315.55
7.1.290.0000.01515.60
7.1.280.0100.00715.32
7.1.270.0030.01015.77
7.1.260.0060.00315.37
7.1.70.0040.00417.12
7.1.60.0100.01319.46
7.1.50.0070.00316.53
7.1.00.0000.08022.48
7.0.200.0000.00716.61
7.0.140.0000.07722.08
7.0.60.0030.08719.79
7.0.50.0070.04317.72
7.0.40.0000.10019.96
7.0.30.0330.07020.23
7.0.20.0130.05020.33
7.0.10.0100.04020.16
7.0.00.0100.08020.10
5.6.280.0000.07321.00
5.6.210.0100.07720.60
5.6.200.0030.06318.21
5.6.190.0030.06320.34
5.6.180.0470.06320.50
5.6.170.0270.04320.55
5.6.160.0100.07720.48
5.6.150.0000.06318.16
5.6.140.0000.04318.15
5.6.130.0000.06718.23
5.6.120.0030.04020.88
5.6.110.0070.04021.10
5.6.100.0100.08020.95
5.6.90.0100.07721.08
5.6.80.0170.07320.36
5.5.350.0100.04320.31
5.5.340.0100.04718.09
5.5.330.0130.07720.26
5.5.320.0370.07720.42
5.5.310.0400.06320.18
5.5.300.0030.04317.98
5.5.290.0100.04717.97
5.5.280.0030.07020.95
5.5.270.0130.07720.88
5.5.260.0100.07720.98
5.5.250.0030.04720.66
5.5.240.0270.06320.16
5.4.450.0670.03719.46
5.4.440.0130.04719.52
5.4.430.0430.05019.27
5.4.420.0070.04719.47
5.4.410.0270.04719.34
5.4.400.0070.04018.88
5.4.390.0100.05019.20
5.4.380.0370.05318.46
5.4.370.0200.06018.56
5.4.360.0370.05018.63
5.4.350.0430.06318.78
5.4.340.0330.06018.61
5.4.320.0040.03912.51
5.4.310.0050.03812.50
5.4.300.0070.03612.51
5.4.290.0050.03812.50
5.4.280.0050.03812.40
5.4.270.0030.04012.40
5.4.260.0040.04012.40
5.4.250.0080.04612.39
5.4.240.0080.03712.40
5.4.230.0080.04412.39
5.4.220.0110.04512.39
5.4.210.0070.04912.39
5.4.200.0080.03712.39
5.4.190.0070.04312.38
5.4.180.0070.03612.38
5.4.170.0080.03512.39
5.4.160.0070.03512.39
5.4.150.0060.03612.39
5.4.140.0080.03912.07
5.4.130.0040.04012.06
5.4.120.0050.04212.02
5.4.110.0090.03512.01
5.4.100.0080.03712.02
5.4.90.0050.03812.02
5.4.80.0050.04912.01
5.4.70.0080.03312.01
5.4.60.0050.03712.01
5.4.50.0050.03612.01
5.4.40.0080.03412.00
5.4.30.0040.04311.99
5.4.20.0070.04311.99
5.4.10.0080.03811.99
5.4.00.0060.03511.48
5.3.290.0040.04312.80
5.3.280.0040.04412.71
5.3.270.0110.03412.73
5.3.260.0070.04812.72
5.3.250.0060.04512.72
5.3.240.0090.05112.71
5.3.230.0100.04112.71
5.3.220.0100.03712.68
5.3.210.0100.04212.68
5.3.200.0080.03612.68
5.3.190.0060.04612.68
5.3.180.0080.03812.68
5.3.170.0060.04412.67
5.3.160.0070.03612.67
5.3.150.0060.03712.67
5.3.140.0080.04412.66
5.3.130.0060.04012.66
5.3.120.0070.03812.65
5.3.110.0070.03812.66
5.3.100.0030.03912.12
5.3.90.0100.03912.10
5.3.80.0070.03612.09
5.3.70.0060.03612.09
5.3.60.0090.03312.08
5.3.50.0060.03612.02
5.3.40.0060.04112.03
5.3.30.0070.03911.98
5.3.20.0080.04311.77
5.3.10.0090.03911.73
5.3.00.0070.03911.72
5.2.170.0030.0339.23
5.2.160.0080.0279.23
5.2.150.0030.0379.23
5.2.140.0060.0339.23
5.2.130.0070.0279.18
5.2.120.0060.0299.19
5.2.110.0080.0369.20
5.2.100.0060.0389.19
5.2.90.0040.0309.19
5.2.80.0060.0299.18
5.2.70.0060.0369.18
5.2.60.0070.0299.14
5.2.50.0050.0369.11
5.2.40.0040.0369.08
5.2.30.0080.0319.06
5.2.20.0040.0349.04
5.2.10.0120.0318.95
5.2.00.0050.0298.82
5.1.60.0050.0248.10
5.1.50.0020.0268.10
5.1.40.0050.0248.07
5.1.30.0050.0258.42
5.1.20.0080.0228.45
5.1.10.0040.0278.18
5.1.00.0040.0288.18
5.0.50.0060.0196.66
5.0.40.0090.0186.52
5.0.30.0030.0326.33
5.0.20.0020.0216.29
5.0.10.0050.0186.28
5.0.00.0040.0316.27
4.4.90.0070.0124.78
4.4.80.0020.0164.76
4.4.70.0030.0164.75
4.4.60.0020.0184.75
4.4.50.0070.0174.77
4.4.40.0050.0234.71
4.4.30.0030.0174.76
4.4.20.0030.0184.84
4.4.10.0060.0194.85
4.4.00.0020.0264.76
4.3.110.0040.0214.67
4.3.100.0040.0184.66
4.3.90.0030.0174.63
4.3.80.0020.0254.58
4.3.70.0040.0134.63
4.3.60.0030.0154.63
4.3.50.0040.0154.63
4.3.40.0020.0264.54
4.3.30.0010.0173.32
4.3.20.0010.0173.30
4.3.10.0030.0153.27
4.3.00.0100.01318.56

preferences:
34.93 ms | 401 KiB | 5 Q