3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function recurseBenchCallerContex($iterations, $recursionLimit) { if($recursionLimit > 0) { $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(1000, 10);

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.0030.02014.95
7.3.120.0060.01814.58
7.3.110.0100.01314.67
7.3.100.0030.01314.77
7.3.90.0070.01314.80
7.3.80.0040.00915.19
7.3.70.0070.01114.63
7.3.60.0000.01214.72
7.3.50.0040.01414.76
7.3.40.0090.00914.84
7.3.30.0160.00614.71
7.3.20.0040.01416.53
7.3.10.0060.01216.91
7.3.00.0130.00616.51
7.2.250.0080.01315.23
7.2.240.0100.01715.25
7.2.230.0000.01615.03
7.2.220.0060.01315.25
7.2.210.0030.02015.26
7.2.200.0030.01715.05
7.2.190.0100.01015.18
7.2.180.0070.01015.04
7.2.170.0070.01314.86
7.2.00.0100.00719.58
7.1.330.0120.00915.71
7.1.320.0070.01715.95
7.1.310.0000.02215.75
7.1.300.0130.00715.52
7.1.290.0030.01915.87
7.1.280.0070.01615.81
7.1.270.0090.00915.86
7.1.260.0000.02016.04
7.1.70.0070.01417.22
7.1.60.0100.01019.46
7.1.50.0060.02216.92
7.1.00.0000.08022.50
7.0.200.0000.01816.50
7.0.140.0000.09022.08
7.0.110.0300.03719.95
7.0.100.0230.04719.96
7.0.90.0070.04319.93
7.0.80.0170.03720.01
7.0.70.0030.06320.03
7.0.60.0100.07020.01
7.0.50.0030.04719.96
7.0.40.0030.04319.75
7.0.30.0070.04719.71
7.0.20.0130.04319.87
7.0.10.0030.04719.65
7.0.00.0000.05019.73
5.6.280.0070.08720.87
5.6.260.0000.04720.68
5.6.250.0070.04320.58
5.6.240.0000.05020.57
5.6.230.0100.07320.70
5.6.220.0130.09320.55
5.6.210.0070.05320.58
5.6.200.0030.05720.64
5.6.190.0030.05320.56
5.6.180.0030.06320.69
5.6.170.0000.05720.59
5.6.160.0030.05020.65
5.6.150.0070.05020.60
5.6.140.0030.05320.65
5.6.130.0100.10320.68
5.6.120.0170.08720.47
5.6.110.0030.05320.63
5.6.100.0030.09320.69
5.6.90.0170.08320.48
5.6.80.0070.08319.94
5.6.70.0030.06720.00
5.6.60.0130.07720.07
5.6.50.0100.07719.98
5.6.40.0070.04320.00
5.6.30.0070.09719.93
5.6.20.0100.07720.02
5.6.10.0070.04320.00
5.6.00.0070.07719.97
5.5.380.0100.03317.69
5.5.370.0030.05017.56
5.5.360.0000.05317.69
5.5.350.0030.07317.68
5.5.340.0000.06018.07
5.5.330.0030.07318.07
5.5.320.0030.06318.13
5.5.310.0000.06017.90
5.5.300.0070.12018.09
5.5.290.0070.05017.93
5.5.280.0100.07718.07
5.5.270.0070.05318.24
5.5.260.0070.05018.11
5.5.250.0030.07017.88
5.5.240.0070.05317.30
5.5.230.0030.06717.50
5.5.220.0130.06017.43
5.5.210.0070.07317.61
5.5.200.0000.05017.28
5.5.190.0130.09317.48
5.5.180.0030.09017.45
5.5.160.0070.07317.26
5.5.150.0030.11317.30
5.5.140.0100.08017.18
5.5.130.0000.05317.27
5.5.120.0100.04717.18
5.5.110.0000.05317.39
5.5.100.0070.04717.17
5.5.90.0030.06017.35
5.5.80.0000.05317.16
5.5.70.0030.05017.46
5.5.60.0070.04717.33
5.5.50.0030.04717.49
5.5.40.0130.08017.34
5.5.30.0030.09717.34
5.5.20.0030.05017.49
5.5.10.0030.04317.20
5.5.00.0100.04317.38
5.4.450.0100.09019.33
5.4.440.0030.05019.36
5.4.430.0100.09719.57
5.4.420.0070.06019.31
5.4.410.0000.06319.44
5.4.400.0030.10019.00
5.4.390.0030.09019.34
5.4.380.0070.08318.99
5.4.370.0070.04319.18
5.4.360.0100.08318.93
5.4.350.0070.04718.95
5.4.340.0100.07319.09
5.4.320.0100.07719.02
5.4.310.0030.07719.22
5.4.300.0100.04319.17
5.4.290.0070.07319.14
5.4.280.0030.06719.36
5.4.270.0100.04319.00
5.4.260.0070.08018.98
5.4.250.0100.05019.00
5.4.240.0100.04319.32
5.4.230.0100.04018.94
5.4.220.0070.04719.02
5.4.210.0030.08019.23
5.4.200.0000.04319.31
5.4.190.0070.06718.98
5.4.180.0100.04319.23
5.4.170.0030.05019.09
5.4.160.0070.04319.32
5.4.150.0070.04719.16
5.4.140.0070.04316.29
5.4.130.0070.06716.28
5.4.120.0070.05316.36
5.4.110.0070.04316.55
5.4.100.0000.05716.38
5.4.90.0070.04316.57
5.4.80.0030.04316.30
5.4.70.0030.06716.26
5.4.60.0030.04016.45
5.4.50.0030.06316.25
5.4.40.0030.04316.53
5.4.30.0030.05716.34
5.4.20.0000.05016.34
5.4.10.0070.06016.52
5.4.00.0000.04015.98

preferences:
32.16 ms | 400 KiB | 5 Q