3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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.0160.00914.90
7.3.120.0130.01014.61
7.3.110.0040.01814.83
7.3.100.0000.01614.96
7.3.90.0030.01615.01
7.3.80.0080.00814.47
7.3.70.0070.01414.82
7.3.60.0000.02014.88
7.3.50.0040.01414.84
7.3.40.0100.00714.63
7.3.30.0030.01314.74
7.3.20.0060.01216.53
7.3.10.0100.01316.61
7.3.00.0000.01316.84
7.2.250.0080.01515.00
7.2.240.0060.01915.24
7.2.230.0000.01915.29
7.2.220.0040.01415.04
7.2.210.0040.01415.09
7.2.200.0070.01415.02
7.2.190.0060.01215.09
7.2.180.0060.01015.12
7.2.170.0060.01215.03
7.2.00.0030.01319.13
7.1.330.0070.01415.55
7.1.320.0030.01616.01
7.1.310.0120.00915.84
7.1.300.0060.01516.02
7.1.290.0070.01015.61
7.1.280.0060.01315.84
7.1.270.0030.01615.87
7.1.260.0070.01415.90
7.1.70.0000.01216.93
7.1.60.0060.01217.41
7.1.50.0170.02434.77
7.1.00.0070.08022.43
7.0.200.0100.02016.69
7.0.140.0070.08021.99
7.0.60.0070.09319.90
7.0.50.0030.09017.75
7.0.40.0100.04320.05
7.0.30.0200.06320.17
7.0.20.0330.05720.24
7.0.10.0070.04720.12
7.0.00.0100.08720.23
5.6.210.0100.05720.86
5.6.200.0070.10318.25
5.6.190.0100.08320.64
5.6.180.0130.09720.77
5.6.170.0200.06020.55
5.6.160.0070.05320.53
5.6.150.0030.05018.29
5.6.140.0100.09318.26
5.6.130.0030.07718.27
5.6.120.0100.05021.25
5.6.110.0030.10721.14
5.6.100.0170.07321.11
5.6.90.0170.09021.10
5.6.80.0070.05720.50
5.5.350.0030.07320.65
5.5.340.0100.07718.12
5.5.330.0070.10020.47
5.5.320.0330.08720.29
5.5.310.0300.05720.23
5.5.300.0000.06718.12
5.5.290.0170.09018.07
5.5.280.0070.09720.89
5.5.270.0030.07720.89
5.5.260.0070.11321.08
5.5.250.0000.05720.91
5.5.240.0300.08320.36
5.4.450.2330.05319.41
5.4.440.2370.05319.32
5.4.430.2470.05019.36
5.4.420.2370.05319.63
5.4.410.2300.04319.42
5.4.400.2400.05019.20
5.4.390.2370.05318.84
5.4.380.2500.05019.00
5.4.370.2500.04718.98
5.4.360.2130.05319.15
5.4.350.2130.06718.87
5.4.340.2170.05019.16
5.4.320.2130.05019.09
5.4.310.2430.05019.19
5.4.300.2200.05018.98
5.4.290.2200.04719.31
5.4.280.1400.05019.16
5.4.270.0200.07318.94
5.4.260.0030.09719.21
5.4.250.0070.07319.22
5.4.240.2670.05319.19
5.4.230.2400.04319.05
5.4.220.2670.05318.94
5.4.210.2430.04718.88
5.4.200.2370.06018.94
5.4.190.2230.04319.21
5.4.180.2630.05719.07
5.4.170.2500.05319.08
5.4.160.2130.04019.06
5.4.150.2600.04719.13
5.4.140.2470.05016.50
5.4.130.3030.04716.43
5.4.120.2330.04316.39
5.4.110.2270.04316.66
5.4.100.2500.04316.37
5.4.90.2430.04716.57
5.4.80.2570.04016.55
5.4.70.2500.04316.46
5.4.60.2370.03716.55
5.4.50.2500.05316.45
5.4.40.2500.04716.27
5.4.30.2700.06016.37
5.4.20.2730.05016.64
5.4.10.2430.05316.57
5.4.00.2170.04716.01

preferences:
35.91 ms | 401 KiB | 5 Q