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(10000, 0);

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.0030.01319.46
7.1.70.0000.01217.13
7.1.60.0070.01819.46
7.1.50.0140.01717.04
7.1.00.0100.07022.36
7.0.200.0030.01316.87
7.0.140.0130.07022.08
7.0.60.0070.08020.04
7.0.50.0000.05017.84
7.0.40.0070.07720.20
7.0.30.0370.06320.12
7.0.20.0230.07020.15
7.0.10.0070.05020.06
7.0.00.0100.06020.22
5.6.280.0030.08721.11
5.6.210.0100.06720.52
5.6.200.0100.09318.13
5.6.190.0100.09020.48
5.6.180.0100.06320.61
5.6.170.0270.08720.45
5.6.160.0070.05720.55
5.6.150.0030.07718.12
5.6.140.0070.07318.15
5.6.130.0100.05318.23
5.6.120.0000.09321.04
5.6.110.0200.08321.12
5.6.100.0070.07721.00
5.6.90.0030.09721.11
5.6.80.0070.06020.39
5.5.350.0000.04020.50
5.5.340.0100.07317.95
5.5.330.0070.07020.26
5.5.320.0170.04720.42
5.5.310.0330.06020.34
5.5.300.0100.09017.97
5.5.290.0070.06018.01
5.5.280.0030.05320.94
5.5.270.0100.04320.68
5.5.260.0030.04720.68
5.5.250.0130.08320.46
5.5.240.0300.06020.07
5.4.450.0230.09019.28
5.4.440.0230.04319.20
5.4.430.0170.04319.54
5.4.420.0270.06719.45
5.4.410.0300.06719.36
5.4.400.0370.08019.09
5.4.390.0030.06018.89
5.4.380.0270.04718.87
5.4.370.0300.04019.27
5.4.360.0130.04719.19
5.4.350.0200.04019.13
5.4.340.0200.08719.31
5.4.320.0070.05612.50
5.4.310.0240.05012.50
5.4.300.0070.04812.50
5.4.290.0030.04912.50
5.4.280.0070.04312.40
5.4.270.0050.04512.40
5.4.260.0090.04312.40
5.4.250.0030.04912.40
5.4.240.0050.04512.40
5.4.230.0030.04912.39
5.4.220.0070.04312.39
5.4.210.0060.04312.39
5.4.200.0060.04412.39
5.4.190.0070.04412.39
5.4.180.0030.04612.39
5.4.170.0120.03912.40
5.4.160.0060.04412.39
5.4.150.0100.04112.39
5.4.140.0110.04612.07
5.4.130.0080.04212.07
5.4.120.0020.04812.02
5.4.110.0040.04412.02
5.4.100.0060.04512.02
5.4.90.0030.04712.01
5.4.80.0030.05112.01
5.4.70.0040.04912.01
5.4.60.0050.04312.01
5.4.50.0040.04512.01
5.4.40.0070.04012.00
5.4.30.0060.04511.99
5.4.20.0080.04012.00
5.4.10.0040.04412.00
5.4.00.0040.04611.48

preferences:
33.62 ms | 401 KiB | 5 Q