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, 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.0070.01115.04
7.3.120.0120.01214.81
7.3.110.0040.01714.88
7.3.100.0030.01614.87
7.3.90.0060.00914.82
7.3.80.0030.01414.98
7.3.70.0070.01014.68
7.3.60.0070.01014.92
7.3.50.0070.01014.83
7.3.40.0030.01314.76
7.3.30.0070.01314.91
7.3.20.0090.00916.82
7.3.10.0100.01016.73
7.3.00.0050.01416.59
7.2.250.0100.01415.37
7.2.240.0030.02315.15
7.2.230.0060.01215.05
7.2.220.0000.01915.16
7.2.210.0000.01415.26
7.2.200.0060.01215.30
7.2.190.0060.00914.91
7.2.180.0040.01415.09
7.2.170.0040.01414.88
7.2.130.0080.01216.96
7.2.120.0040.01816.95
7.2.110.0000.01516.57
7.2.100.0100.01016.84
7.2.90.0060.00616.82
7.2.80.0030.01417.05
7.2.70.0040.01117.02
7.2.60.0030.01217.16
7.2.50.0070.00716.62
7.2.40.0090.00916.79
7.2.30.0070.01016.78
7.2.20.0070.01117.02
7.2.10.0090.00917.02
7.2.00.0090.00918.24
7.1.330.0100.01315.94
7.1.320.0030.01716.02
7.1.310.0030.01415.48
7.1.300.0060.01615.85
7.1.290.0000.02115.58
7.1.280.0030.01715.62
7.1.270.0030.01615.79
7.1.260.0100.01015.68
7.1.250.0070.01015.61
7.1.240.0130.00715.69
7.1.230.0070.00715.93
7.1.220.0100.01015.82
7.1.210.0040.01415.82
7.1.200.0070.01315.92
7.1.190.0030.01515.83
7.1.180.0000.01815.89
7.1.170.0040.01415.87
7.1.160.0000.01516.02
7.1.150.0030.01615.61
7.1.140.0030.01815.71
7.1.130.0030.01515.89
7.1.120.0040.01415.63
7.1.110.0000.01915.90
7.1.100.0040.01515.95
7.1.90.0100.01015.84
7.1.80.0070.01015.63
7.1.70.0080.01216.42
7.1.60.0090.01117.58
7.1.50.0050.01416.35
7.1.40.0030.01216.02
7.1.30.0000.01715.96
7.1.20.0000.01715.88
7.1.10.0070.01315.53
7.1.00.0050.05019.12
7.0.330.0000.02615.52
7.0.320.0000.02315.13
7.0.310.0090.01515.36
7.0.300.0060.02215.39
7.0.290.0070.02015.55
7.0.280.0040.02115.39
7.0.270.0090.01515.40
7.0.260.0030.02315.34
7.0.250.0060.01915.39
7.0.240.0030.02215.50
7.0.230.0060.01915.48
7.0.220.0000.02415.50
7.0.210.0060.01915.53
7.0.200.0030.01415.96
7.0.190.0090.01515.28
7.0.180.0030.02315.32
7.0.170.0000.02415.54
7.0.160.0070.01715.46
7.0.150.0030.02115.14
7.0.140.0050.05018.64
7.0.130.0030.02015.16
7.0.120.0120.01215.18
7.0.110.0070.05517.67
7.0.100.0060.03917.59
7.0.90.0050.05517.77
7.0.80.0120.05017.76
7.0.70.0100.05217.72
7.0.60.0060.05417.66
7.0.50.0110.04617.67
7.0.40.0100.05116.58
7.0.30.0080.05216.66
7.0.20.0020.05516.57
7.0.10.0070.05516.57
7.0.00.0110.04716.52
5.6.380.0030.03114.65
5.6.370.0060.02914.44
5.6.360.0070.03014.64
5.6.350.0060.03114.39
5.6.340.0000.02714.41
5.6.330.0070.02814.82
5.6.320.0030.02414.60
5.6.310.0030.02814.89
5.6.300.0000.03514.62
5.6.290.0030.02914.53
5.6.280.0030.06417.74
5.6.270.0030.02914.76
5.6.260.0080.06217.79
5.6.250.0070.06417.54
5.6.240.0080.06317.52
5.6.230.0120.06117.53
5.6.220.0070.06117.73
5.6.210.0130.05317.81
5.6.200.0100.05817.50
5.6.190.0080.05917.77
5.6.180.0100.04617.67
5.6.170.0080.06517.66
5.6.160.0100.05017.59
5.6.150.0100.05617.45
5.6.140.0070.05917.67
5.6.130.0050.04917.72
5.6.120.0120.05617.83
5.6.110.0020.06717.69
5.6.100.0080.06417.80
5.6.90.0070.04217.50
5.6.80.0050.05817.43
5.6.70.0050.05517.27
5.6.60.0080.05817.42
5.6.50.0050.05617.28
5.6.40.0100.06017.23
5.6.30.0000.06417.35
5.6.20.0100.06017.24
5.6.10.0120.05917.26
5.6.00.0070.05517.30
5.5.380.0120.05915.82
5.5.370.0080.06115.81
5.5.360.0050.06415.98
5.5.350.0050.06715.87
5.5.340.0100.06015.94
5.5.330.0070.04416.09
5.5.320.0030.06816.22
5.5.310.0080.06416.34
5.5.300.0020.07216.13
5.5.290.0070.06616.00
5.5.280.0070.06115.99
5.5.270.0080.06116.10
5.5.260.0080.06016.20
5.5.250.0080.05516.15
5.5.240.0070.06315.72
5.5.230.0000.06915.68
5.5.220.0050.06215.76
5.5.210.0070.06115.55
5.5.200.0090.04415.71
5.5.190.0070.05915.62
5.5.180.0130.04015.63
5.5.170.0040.02511.35
5.5.160.0080.05715.77
5.5.150.0050.04515.94
5.5.140.0080.05415.76
5.5.130.0070.05315.78
5.5.120.0080.05715.68
5.5.110.0030.06415.61
5.5.100.0020.06615.59
5.5.90.0070.04515.72
5.5.80.0020.04715.71
5.5.70.0030.05015.72
5.5.60.0000.04215.56
5.5.50.0050.03715.70
5.5.40.0030.04015.66
5.5.30.0040.03915.71
5.5.20.0030.03815.62
5.5.10.0050.03915.77
5.5.00.0050.04015.59
5.4.450.0070.06315.21
5.4.440.0100.05815.30
5.4.430.0050.05815.13
5.4.420.0050.05215.41
5.4.410.0020.05915.23
5.4.400.0050.05915.23
5.4.390.0070.05515.12
5.4.380.0060.06415.25
5.4.370.0020.06715.04
5.4.360.0080.05215.04
5.4.350.0050.05114.93
5.4.340.0070.05915.04
5.4.330.0070.02311.18
5.4.320.0090.06115.07
5.4.310.0030.05915.20
5.4.300.0090.05815.06
5.4.290.0100.05915.33
5.4.280.0070.06015.05
5.4.270.0030.06314.98
5.4.260.0080.05315.15
5.4.250.0110.05615.04
5.4.240.0060.04815.04
5.4.230.0030.03715.12
5.4.220.0030.04615.12
5.4.210.0030.03915.03
5.4.200.0070.03315.15
5.4.190.0080.03115.10
5.4.180.0050.04114.99
5.4.170.0080.03015.05
5.4.160.0020.05415.05
5.4.150.0030.04615.10
5.4.140.0030.06113.87
5.4.130.0060.03313.67
5.4.120.0030.04913.82
5.4.110.0070.03913.84
5.4.100.0030.04013.90
5.4.90.0030.04613.73
5.4.80.0000.04013.96
5.4.70.0080.03713.83
5.4.60.0030.03813.75
5.4.50.0020.03813.95
5.4.40.0030.03813.67
5.4.30.0050.03413.78
5.4.20.0070.03513.90
5.4.10.0050.03813.94
5.4.00.0030.03613.59
5.3.290.0050.04312.78
5.3.280.0030.02012.86
5.3.270.0050.01812.82
5.3.260.0050.03812.75
5.3.250.0050.03812.86
5.3.240.0050.03412.79
5.3.230.0070.01512.79
5.3.220.0020.02312.73
5.3.210.0030.02212.80
5.3.200.0020.02512.73
5.3.190.0000.02412.74
5.3.180.0030.03512.72
5.3.170.0070.01712.73
5.3.160.0040.02012.79
5.3.150.0020.02112.71
5.3.140.0040.02012.75
5.3.130.0040.02012.72
5.3.120.0030.01812.79
5.3.110.0000.02312.77
5.3.100.0010.02312.47
5.3.90.0010.02112.53
5.3.80.0080.01712.44
5.3.70.0020.02212.50
5.3.60.0020.02112.56
5.3.50.0050.03412.43
5.3.40.0050.01812.54
5.3.30.0050.01912.42
5.3.20.0030.02712.33
5.3.10.0020.01912.29
5.3.00.0070.01812.29
5.2.170.0080.02311.47
5.2.160.0000.01911.47
5.2.150.0050.01311.47
5.2.140.0050.01311.47
5.2.130.0050.02211.47
5.2.120.0020.01711.47
5.2.110.0020.01911.47
5.2.100.0020.02211.47
5.2.90.0050.01511.47
5.2.80.0020.01711.47
5.2.70.0050.02111.47
5.2.60.0050.02211.47
5.2.50.0020.03411.47
5.2.40.0080.02611.47
5.2.30.0020.03511.47
5.2.20.0000.03411.47
5.2.10.0030.03111.47
5.2.00.0090.02711.47
5.1.60.0050.02411.47
5.1.50.0040.03011.47
5.1.40.0080.02711.47
5.1.30.0060.02711.47
5.1.20.0030.02011.47
5.1.10.0020.03111.47
5.1.00.0070.02211.47
5.0.50.0010.02411.47
5.0.40.0010.01611.47
5.0.30.0020.03311.47
5.0.20.0020.02311.47
5.0.10.0020.02411.47
5.0.00.0000.04011.47
4.4.90.0030.00811.47
4.4.80.0020.02111.47
4.4.70.0010.01611.47
4.4.60.0000.01411.47
4.4.50.0030.01711.47
4.4.40.0020.02911.47
4.4.30.0050.01511.47
4.4.20.0020.01811.47
4.4.10.0020.01811.47
4.4.00.0000.02811.47
4.3.110.0020.02111.47
4.3.100.0000.01211.47
4.3.90.0020.01911.47
4.3.80.0000.01711.47
4.3.70.0000.02011.47
4.3.60.0050.02011.47
4.3.50.0050.00811.47
4.3.40.0050.02011.47
4.3.30.0000.02011.47
4.3.20.0010.01911.47
4.3.10.0000.01211.47
4.3.00.0020.01811.47

preferences:
32.55 ms | 400 KiB | 5 Q