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, 4); $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(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.0090.00919.54
7.1.70.0050.00816.93
7.1.60.0070.02519.46
7.1.50.0170.01717.04
7.1.00.0100.07722.44
7.0.200.0000.02416.76
7.0.140.0070.08722.09
7.0.60.0000.05319.96
7.0.50.0100.09017.79
7.0.40.0070.11020.40
7.0.30.0230.07720.23
7.0.20.0370.08720.08
7.0.10.0100.05020.13
7.0.00.0070.05720.41
5.6.280.0030.10721.09
5.6.210.0030.09020.84
5.6.200.0100.10018.24
5.6.190.0030.10320.61
5.6.180.0270.08020.67
5.6.170.0230.10320.44
5.6.160.0070.06320.45
5.6.150.0070.08018.23
5.6.140.0030.06018.21
5.6.130.0070.10318.17
5.6.120.0030.05721.23
5.6.110.0130.10321.09
5.6.100.0070.05321.22
5.6.90.0100.07721.08
5.6.80.0030.08720.39
5.5.350.0200.07720.42
5.5.340.0070.11017.95
5.5.330.0100.10720.47
5.5.320.0030.11320.51
5.5.310.0170.09320.32
5.5.300.0030.05718.07
5.5.290.0130.09718.08
5.5.280.0000.08020.98
5.5.270.0070.10020.87
5.5.260.0070.09020.94
5.5.250.0170.09720.60
5.5.240.0030.10720.38
5.4.450.0230.07019.31
5.4.440.0200.10319.41
5.4.430.0200.10019.47
5.4.420.0270.09319.64
5.4.410.0230.09719.05
5.4.400.0200.10019.08
5.4.390.0200.09018.99
5.4.380.0130.11019.06
5.4.370.0300.06319.05
5.4.360.0200.05319.09
5.4.350.0200.10018.87
5.4.340.0270.08318.85
5.4.320.0270.05718.88
5.4.310.0300.09019.09
5.4.300.0400.06319.14
5.4.290.0270.09719.19
5.4.280.0200.05319.16
5.4.270.0230.09718.85
5.4.260.0200.07719.31
5.4.250.0230.06319.07
5.4.240.0200.07719.25
5.4.230.0330.08319.21
5.4.220.0230.09319.05
5.4.210.0200.05718.98
5.4.200.0200.08319.31
5.4.190.0270.09718.97
5.4.180.0200.09319.30
5.4.170.0230.07319.07
5.4.160.0170.10019.14
5.4.150.0200.10018.92
5.4.140.0200.09716.61
5.4.130.0230.05716.48
5.4.120.0200.05716.64
5.4.110.0200.09316.32
5.4.100.0300.07016.57
5.4.90.0300.06316.57
5.4.80.0270.09016.65
5.4.70.0230.09016.55
5.4.60.0230.07716.64
5.4.50.0230.05716.36
5.4.40.0300.09016.51
5.4.30.0200.05016.54
5.4.20.0230.09016.53
5.4.10.0300.07716.54
5.4.00.0170.08015.92
5.3.290.0300.07014.57
5.3.280.0270.07314.71
5.3.270.0300.06314.68
5.3.260.0230.07714.51
5.3.250.0270.05714.62
5.3.240.0230.06714.53
5.3.230.0230.06714.64
5.3.220.0370.06314.68
5.3.210.0270.04714.56
5.3.200.0300.05714.46
5.3.190.0270.06714.72
5.3.180.0230.07314.47
5.3.170.0200.05714.61
5.3.160.0200.03714.72
5.3.150.0270.03014.64
5.3.140.0200.03714.68
5.3.130.0230.07314.47
5.3.120.0270.06714.45
5.3.110.0300.05314.66
5.3.100.0300.06314.05
5.3.90.0230.05014.02
5.3.80.0370.06014.18
5.3.70.0100.05713.93
5.3.60.0200.07314.22
5.3.50.0200.06714.02
5.3.40.0200.06013.86
5.3.30.0230.07013.98
5.3.20.0170.05313.60
5.3.10.0230.05013.77
5.3.00.0100.04713.80
5.2.170.0330.03711.08
5.2.160.0230.03311.24
5.2.150.0230.05711.05
5.2.140.0270.03011.16
5.2.130.0200.05311.04
5.2.120.0200.05711.11
5.2.110.0230.04011.08
5.2.100.0170.05311.00
5.2.90.0230.05311.11
5.2.80.0170.06011.00
5.2.70.0270.04711.10
5.2.60.0170.04011.06
5.2.50.0170.06011.02
5.2.40.0130.04311.09
5.2.30.0170.04310.87
5.2.20.0200.04311.11
5.2.10.0200.03710.79
5.2.00.0270.05010.73
5.1.60.0100.03710.52
5.1.50.0200.04710.52
5.1.40.0130.04710.52
5.1.30.0230.03710.52
5.1.20.0100.04310.52
5.1.10.0200.04010.52
5.1.00.0200.04710.52
5.0.50.0130.03710.52
5.0.40.0070.02710.52
5.0.30.0070.06710.52
5.0.20.0100.03310.52
5.0.10.0030.03010.52
5.0.00.0130.04310.52
4.4.90.0100.03010.52
4.4.80.0070.02010.52
4.4.70.0030.02710.52
4.4.60.0130.03010.52
4.4.50.0070.03710.52
4.4.40.0100.03710.52
4.4.30.0170.02310.52
4.4.20.0070.02310.52
4.4.10.0130.03310.52
4.4.00.0100.05310.52
4.3.110.0070.03710.52
4.3.100.0030.02310.52
4.3.90.0100.03310.52
4.3.80.0070.03310.52
4.3.70.0130.01710.52
4.3.60.0000.03010.52
4.3.50.0100.03310.52
4.3.40.0100.05010.52
4.3.30.0030.02310.52
4.3.20.0030.02310.52
4.3.10.0000.02310.52
4.3.00.0070.03010.52

preferences:
36.39 ms | 401 KiB | 5 Q