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(); } 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.0060.01014.99
7.3.110.0030.01314.93
7.3.100.0070.01314.83
7.3.90.0030.01214.68
7.3.80.0030.00914.66
7.3.70.0060.01215.04
7.3.60.0030.01314.87
7.3.50.0070.01414.61
7.3.40.0000.01514.67
7.3.30.0030.01014.74
7.3.20.0080.01216.55
7.3.10.0040.01516.62
7.3.00.0070.01016.80
7.2.240.0030.01714.75
7.2.230.0030.01715.32
7.2.220.0060.00915.21
7.2.210.0030.01315.04
7.2.200.0070.01015.39
7.2.190.0030.01415.02
7.2.180.0000.01215.32
7.2.170.0070.01015.07
7.2.160.0060.01315.02
7.2.150.0000.02016.94
7.2.140.0030.01716.73
7.2.130.0100.00717.00
7.2.120.0040.01416.72
7.2.110.0080.00816.84
7.2.100.0040.01416.82
7.2.90.0130.01016.95
7.2.80.0040.01116.66
7.2.70.0060.01217.07
7.2.60.0100.00717.08
7.2.50.0070.01516.89
7.2.40.0070.01317.16
7.2.30.0060.00916.93
7.2.20.0070.01117.17
7.2.10.0090.00916.78
7.2.00.0070.01018.26
7.1.330.0030.01615.87
7.1.320.0030.01615.89
7.1.310.0090.01215.56
7.1.300.0060.00915.63
7.1.290.0130.00615.59
7.1.280.0000.01715.99
7.1.270.0070.01415.90
7.1.260.0070.01315.84
7.1.250.0090.01215.87
7.1.70.0030.00717.33
7.1.60.0100.01619.46
7.1.50.0070.01117.03
7.1.00.0100.07722.41
7.0.200.0000.01316.79
7.0.140.0030.08322.17
7.0.120.0000.08022.11
7.0.110.0070.04721.98
7.0.100.0000.06022.07
7.0.90.0000.04022.03
7.0.80.0000.04722.05
7.0.70.0100.05722.02
7.0.60.0030.04722.00
7.0.50.0000.05322.05
7.0.40.0070.09720.13
7.0.30.0000.05020.11
7.0.20.0030.04319.98
7.0.10.0070.04320.10
7.0.00.0070.05720.13
5.6.280.0070.09021.21
5.6.270.0070.05721.15
5.6.260.0030.05721.17
5.6.250.0070.03721.12
5.6.240.0000.06320.93
5.6.230.0000.06721.08
5.6.220.0030.05021.04
5.6.210.0000.09320.91
5.6.200.0030.05021.11
5.6.190.0030.04720.95
5.6.180.0070.08320.88
5.6.170.0000.06721.06
5.6.160.0230.02721.08
5.6.150.0070.09320.90
5.6.140.0070.07721.10
5.6.130.0030.09720.90
5.6.120.0100.06721.03
5.6.110.0000.08721.10
5.6.100.0070.07720.88
5.6.90.0000.09321.03
5.6.80.0070.04320.23
5.6.70.0070.08320.48
5.6.60.0070.07020.47
5.6.50.0030.09020.32
5.6.40.0070.07020.44
5.6.30.0000.09720.35
5.6.20.0070.09020.48
5.6.10.0070.04320.23
5.6.00.0030.06720.46
5.5.380.0030.08317.72
5.5.370.0000.05017.50
5.5.360.0100.06017.48
5.5.350.0100.06317.69
5.5.340.0070.04318.07
5.5.330.0070.09718.09
5.5.320.0000.05317.83
5.5.310.0130.07718.22
5.5.300.0030.08018.14
5.5.290.0030.10017.93
5.5.280.0000.10318.07
5.5.270.0030.08718.18
5.5.260.0070.08718.12
5.5.250.0070.09317.64
5.5.240.0030.05717.51
5.5.230.0030.08317.52
5.5.220.0070.07317.43
5.5.210.0030.06317.61
5.5.200.0000.05717.48
5.5.190.0100.08717.18
5.5.180.0000.05717.45
5.5.160.0070.09017.45
5.5.150.0070.04317.57
5.5.140.0070.07017.28
5.5.130.0030.04717.57
5.5.120.0030.05717.26
5.5.110.0030.06017.18
5.5.100.0030.04717.33
5.5.90.0070.07317.47
5.5.80.0100.09717.50
5.5.70.0030.04017.07
5.5.60.0070.04717.30
5.5.50.0000.05717.37
5.5.40.0030.04717.34
5.5.30.0030.05317.34
5.5.20.0030.07717.46
5.5.10.0070.08317.37
5.5.00.0100.08717.34
5.4.450.0070.08719.29
5.4.440.0030.09019.29
5.4.430.0000.05019.45
5.4.420.0070.09319.36
5.4.410.0030.06719.14
5.4.400.0000.09318.98
5.4.390.0000.06719.26
5.4.380.0000.07319.18
5.4.370.0100.07318.96
5.4.360.0100.07319.29
5.4.350.0130.08319.30
5.4.340.0000.09718.98
5.4.320.0000.08019.27
5.4.310.0030.04718.95
5.4.300.0100.05018.95
5.4.290.0000.04719.13
5.4.280.0030.07319.13
5.4.270.0070.10019.28
5.4.260.0070.07318.90
5.4.250.0070.08019.12
5.4.240.0000.05018.95
5.4.230.0070.03319.18
5.4.220.0030.08019.11
5.4.210.0030.06019.03
5.4.200.0030.05318.97
5.4.190.0030.10019.17
5.4.180.0200.07018.94
5.4.170.0170.06319.12
5.4.160.0130.08318.95
5.4.150.0030.08719.09
5.4.140.0030.04716.40
5.4.130.0130.06316.50
5.4.120.0100.08016.52
5.4.110.0000.08316.48
5.4.100.0000.07016.64
5.4.90.0070.04316.56
5.4.80.0070.07316.52
5.4.70.0070.08716.47
5.4.60.0170.08016.57
5.4.50.0000.05016.41
5.4.40.0030.06316.23
5.4.30.0130.08016.51
5.4.20.0030.04316.55
5.4.10.0170.08016.59
5.4.00.0030.10015.89
5.3.290.0070.03714.79
5.3.280.0030.03314.60
5.3.270.0070.08014.63
5.3.260.0030.07014.58
5.3.250.0100.02714.68
5.3.240.0130.06014.56
5.3.230.0070.07314.63
5.3.220.0030.08314.57
5.3.210.0070.06014.66
5.3.200.0030.03714.65
5.3.190.0030.04314.70
5.3.180.0030.07714.54
5.3.170.0030.06714.64
5.3.160.0000.04714.57
5.3.150.0070.06714.56
5.3.140.0000.05014.79
5.3.130.0070.06714.67
5.3.120.0000.07014.67
5.3.110.0000.07314.63
5.3.100.0000.07014.17
5.3.90.0070.07014.04
5.3.80.0130.02314.16
5.3.70.0000.07014.08
5.3.60.0100.07014.01
5.3.50.0100.07313.98
5.3.40.0100.04314.02
5.3.30.0030.06313.87
5.3.20.0030.05013.70
5.3.10.0100.06313.74
5.3.00.0000.04713.67
5.2.170.0070.06011.28
5.2.160.0030.03011.23
5.2.150.0030.06011.23
5.2.140.0000.03011.22
5.2.130.0000.03011.11
5.2.120.0030.05711.33
5.2.110.0000.06311.10
5.2.100.0000.03011.20
5.2.90.0070.06011.10
5.2.80.0030.04011.18
5.2.70.0030.02711.09
5.2.60.0030.05011.14
5.2.50.0030.06011.09
5.2.40.0030.06010.99
5.2.30.0030.02710.83
5.2.20.0000.02711.04
5.2.10.0000.05710.89
5.2.00.0070.02710.71
5.1.60.0030.0539.99
5.1.50.0030.0309.98
5.1.40.0030.0439.95
5.1.30.0030.05710.36
5.1.20.0000.02710.34
5.1.10.0030.0539.91
5.1.00.0070.02010.05
5.0.50.0000.0509.66
5.0.40.0070.0139.66
5.0.30.0030.0539.66
5.0.20.0030.0409.66
5.0.10.0070.0379.66
5.0.00.0030.0579.66
4.4.90.0000.0139.66
4.4.80.0030.0379.66
4.4.70.0000.0279.66
4.4.60.0000.0209.66
4.4.50.0000.0239.66
4.4.40.0070.0209.66
4.4.30.0000.0139.66
4.4.20.0070.0109.66
4.4.10.0000.0239.66
4.4.00.0030.0239.66
4.3.110.0000.0139.66
4.3.100.0000.0209.66
4.3.90.0030.0109.66
4.3.80.0000.0239.66
4.3.70.0070.0279.66
4.3.60.0000.0309.66
4.3.50.0070.0279.66
4.3.40.0070.0209.66
4.3.30.0000.0309.66
4.3.20.0000.0279.66
4.3.10.0030.0309.66
4.3.00.0000.0179.66

preferences:
42.8 ms | 401 KiB | 5 Q