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', $trace, 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.3.120.0070.01414.71
7.3.110.0130.01014.72
7.3.100.0060.01314.70
7.3.90.0000.01914.78
7.3.80.0090.01214.97
7.3.70.0000.02314.83
7.3.60.0060.01314.92
7.3.50.0130.01014.93
7.3.40.0030.02014.70
7.3.30.0060.01614.87
7.3.20.0070.01316.71
7.3.10.0060.01316.45
7.3.00.0060.01516.62
7.2.240.0030.01615.43
7.2.230.0030.01715.07
7.2.220.0070.01715.28
7.2.210.0120.00915.39
7.2.200.0030.01914.95
7.2.190.0070.01714.86
7.2.180.0060.01615.01
7.2.170.0030.02214.89
7.2.160.0030.01914.82
7.2.150.0030.01916.74
7.2.140.0040.01916.83
7.2.130.0070.01616.85
7.2.120.0080.01316.82
7.2.110.0060.01416.68
7.2.100.0100.01116.57
7.2.90.0030.01716.83
7.2.80.0070.01316.72
7.2.70.0050.01717.07
7.2.60.0050.01516.89
7.2.50.0080.01416.95
7.2.40.0040.01916.99
7.2.30.0050.01516.90
7.2.20.0100.01416.81
7.2.10.0090.01516.98
7.2.00.0040.01917.64
7.1.330.0100.01315.82
7.1.320.0130.01016.07
7.1.310.0090.01215.83
7.1.300.0060.01615.79
7.1.290.0070.01615.84
7.1.280.0030.01615.82
7.1.270.0000.01815.60
7.1.260.0070.01715.78
7.1.250.0060.01515.63
7.1.240.0090.01215.88
7.1.230.0100.01315.54
7.1.220.0030.01915.46
7.1.210.0160.01015.81
7.1.200.0000.02415.71
7.1.190.0040.01415.83
7.1.180.0060.01515.99
7.1.170.0100.01315.59
7.1.160.0000.01515.86
7.1.150.0040.01815.74
7.1.140.0090.01215.96
7.1.130.0070.01815.51
7.1.120.0000.02015.63
7.1.110.0030.01715.93
7.1.100.0060.01615.78
7.1.90.0100.01715.82
7.1.80.0040.01515.74
7.1.70.0020.01316.35
7.1.60.0030.02617.54
7.1.50.0030.01916.25
7.1.40.0030.01915.79
7.1.30.0070.01715.87
7.1.20.0060.01615.91
7.1.10.0000.02315.69
7.1.00.0060.04919.16
7.0.330.0030.03115.37
7.0.320.0060.02315.11
7.0.310.0100.01715.45
7.0.300.0070.02415.58
7.0.290.0030.02715.45
7.0.280.0030.02515.61
7.0.270.0070.02415.18
7.0.260.0060.02815.43
7.0.250.0040.02615.11
7.0.240.0030.02715.46
7.0.230.0070.02415.54
7.0.220.0060.02215.31
7.0.210.0040.02815.41
7.0.200.0030.02716.12
7.0.190.0060.02615.46
7.0.180.0000.03315.50
7.0.170.0000.03215.32
7.0.160.0040.02615.32
7.0.150.0100.02315.43
7.0.140.0060.05318.62
7.0.130.0090.01915.46
7.0.120.0000.03115.39
7.0.110.0090.02515.24
7.0.100.0070.02715.57
7.0.90.0000.02815.23
7.0.80.0070.02415.47
7.0.70.0060.02415.38
7.0.60.0100.05717.64
7.0.50.0050.04116.60
7.0.40.0030.04316.79
7.0.30.0170.05816.76
7.0.20.0130.03516.81
7.0.10.0030.06416.62
7.0.00.0030.05216.88
5.6.380.0070.03614.68
5.6.370.0030.03714.59
5.6.360.0030.04114.57
5.6.350.0070.03614.47
5.6.340.0030.04014.59
5.6.330.0070.03714.59
5.6.320.0070.04014.61
5.6.310.0090.03114.52
5.6.300.0100.03314.53
5.6.290.0070.04314.44
5.6.280.0050.07017.75
5.6.270.0000.04414.37
5.6.260.0030.03814.28
5.6.250.0040.04614.31
5.6.240.0070.04314.62
5.6.230.0070.04014.38
5.6.220.0060.04214.41
5.6.210.0080.06017.61
5.6.200.0080.07316.41
5.6.190.0070.07617.33
5.6.180.0310.06217.35
5.6.170.0230.04817.49
5.6.160.0070.04917.56
5.6.150.0080.07316.33
5.6.140.0030.05516.34
5.6.130.0050.07016.41
5.6.120.0070.06217.85
5.6.110.0100.05517.93
5.6.100.0100.04817.78
5.6.90.0050.06017.64
5.6.80.0070.06917.62
5.6.70.0030.04014.29
5.6.60.0030.04014.43
5.6.50.0030.03914.41
5.6.40.0070.04014.55
5.6.30.0030.03814.29
5.6.20.0060.03514.23
5.6.10.0100.03014.42
5.6.00.0070.03414.38
5.5.380.0070.03711.54
5.5.370.0040.03911.54
5.5.360.0000.03811.58
5.5.350.0080.07716.04
5.5.340.0070.07114.72
5.5.330.0020.07615.68
5.5.320.0030.07415.89
5.5.310.0200.06215.73
5.5.300.0020.04814.45
5.5.290.0050.07814.45
5.5.280.0050.08516.22
5.5.270.0080.04416.02
5.5.260.0100.07216.09
5.5.250.0070.07015.74
5.5.240.0070.07315.81
5.5.230.0030.03611.04
5.5.220.0030.04311.37
5.5.210.0070.03710.95
5.5.200.0030.03711.16
5.5.190.0000.04611.10
5.5.180.0000.04411.17
5.5.170.0000.03911.54
5.5.160.0070.03611.13
5.5.150.0060.04211.13
5.5.140.0030.03710.86
5.5.130.0000.03811.18
5.5.120.0000.04511.17
5.5.110.0130.02810.74
5.5.100.0000.03610.99
5.5.90.0030.03611.02
5.5.80.0040.03611.11
5.5.70.0000.04011.14
5.5.60.0000.03810.77
5.5.50.0030.04011.04
5.5.40.0030.05010.96
5.5.30.0070.03811.11
5.5.20.0100.03710.93
5.5.10.0070.03711.18
5.5.00.0030.04611.34
5.4.450.0130.05715.00
5.4.440.0180.05515.06
5.4.430.0080.05815.06
5.4.420.0100.05815.24
5.4.410.0170.05915.22
5.4.400.0170.05314.88
5.4.390.0170.05715.09
5.4.380.0100.07114.96
5.4.370.0180.06514.95
5.4.360.0130.06114.82
5.4.350.0180.06214.75
5.4.340.0250.08314.84
5.4.330.0070.03311.16
5.4.320.0040.05411.69
5.4.310.0060.04811.85
5.4.300.0070.05211.89
5.4.290.0070.04511.84
5.4.280.0020.05211.88
5.4.270.0030.05511.66
5.4.260.0070.04711.79
5.4.250.0050.05511.78
5.4.240.0070.05011.79
5.4.230.0060.05111.78
5.4.220.0050.05211.82
5.4.210.0030.05111.85
5.4.200.0050.04911.80
5.4.190.0050.05111.81
5.4.180.0070.05311.90
5.4.170.0080.05011.78
5.4.160.0070.05211.82
5.4.150.0050.05011.72
5.4.140.0050.04911.65
5.4.130.0060.04511.55
5.4.120.0080.05011.50
5.4.110.0080.04711.66
5.4.100.0080.05211.52
5.4.90.0060.05111.62
5.4.80.0080.04411.46
5.4.70.0050.05011.64
5.4.60.0090.04611.61
5.4.50.0110.04911.73
5.4.40.0040.05511.47
5.4.30.0070.05311.53
5.4.20.0090.05011.74
5.4.10.0040.05011.71
5.4.00.0080.04511.42
5.3.290.0040.02611.68
5.3.280.0050.02611.59
5.3.270.0070.02311.59
5.3.260.0070.02311.52
5.3.250.0060.02911.57
5.3.240.0040.02611.52
5.3.230.0080.02011.63
5.3.220.0070.02411.46
5.3.210.0070.02511.49
5.3.200.0090.02011.49
5.3.190.0050.02911.51
5.3.180.0090.02111.59
5.3.170.0100.01911.47
5.3.160.0100.02111.59
5.3.150.0080.02511.56
5.3.140.0100.02511.48
5.3.130.0090.02811.51
5.3.120.0090.02011.53
5.3.110.0100.02311.51
5.3.100.0060.02211.23
5.3.90.0060.02211.28
5.3.80.0030.02511.20
5.3.70.0060.02111.21
5.3.60.0080.01911.24
5.3.50.0040.02211.13
5.3.40.0050.02411.12
5.3.30.0040.02311.05
5.3.20.0050.02411.05
5.3.10.0070.02110.88
5.3.00.0050.02310.81
5.2.170.0050.0159.22
5.2.160.0040.0179.21
5.2.150.0050.0209.35
5.2.140.0060.0189.33
5.2.130.0060.0159.19
5.2.120.0040.0199.32
5.2.110.0060.0159.28
5.2.100.0050.0179.31
5.2.90.0040.0209.06
5.2.80.0050.0209.07
5.2.70.0050.0199.19
5.2.60.0050.0199.18
5.2.50.0070.0169.22
5.2.40.0070.0189.09
5.2.30.0020.0219.06
5.2.20.0030.0199.11
5.2.10.0070.0198.87
5.2.00.0070.0178.92
5.1.60.0040.0188.27
5.1.50.0020.0178.13
5.1.40.0040.0138.25
5.1.30.0040.0178.58
5.1.20.0040.0168.44
5.1.10.0040.0158.42
5.1.00.0040.0158.24
5.0.50.0020.0207.41
5.0.40.0020.0147.34
5.0.30.0040.0207.25
5.0.20.0060.0097.23
5.0.10.0050.0127.22
5.0.00.0010.0207.22
4.4.90.0020.0106.47
4.4.80.0050.0086.46
4.4.70.0020.0126.46
4.4.60.0020.0106.46
4.4.50.0030.0116.47
4.4.40.0020.0156.44
4.4.30.0040.0146.46
4.4.20.0020.0096.51
4.4.10.0030.0126.51
4.4.00.0020.0156.46
4.3.110.0030.0096.42
4.3.100.0020.0126.42
4.3.90.0020.0116.40
4.3.80.0020.0186.38
4.3.70.0060.0106.40
4.3.60.0030.0086.40
4.3.50.0030.0126.40
4.3.40.0050.0166.35
4.3.30.0020.0125.74
4.3.20.0010.0115.73
4.3.10.0020.0125.72
4.3.00.0030.00913.36

preferences:
36.71 ms | 401 KiB | 5 Q