3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mimicking($obj, $exec){ var_dump(debug_backtrace()); return (function() use($exec){ return $exec(); })->bindTo(null, $obj)(); } class A{ protected $stuff = 10; function test(){ return new class($this){ function __construct(A $s){ $this->s = $s; } function asd(){ return mimicking($this->s, function(){ return $this->s->stuff; }); } }; } } $x = new A; echo $x->test()->asd();

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)
8.3.60.0070.01418.68
8.3.50.0080.00817.92
8.3.40.0080.00818.77
8.3.30.0120.00918.92
8.3.20.0040.00420.39
8.3.10.0040.00420.70
8.3.00.0050.00320.68
8.2.180.0090.00916.75
8.2.170.0150.00022.96
8.2.160.0090.00622.17
8.2.150.0060.00324.18
8.2.140.0030.00524.66
8.2.130.0080.00021.17
8.2.120.0040.00426.35
8.2.110.0030.00719.27
8.2.100.0060.00617.93
8.2.90.0050.00319.09
8.2.80.0060.00317.97
8.2.70.0030.00617.75
8.2.60.0040.00418.05
8.2.50.0080.00018.09
8.2.40.0060.00620.42
8.2.30.0050.00219.43
8.2.20.0050.00317.80
8.2.10.0040.00418.00
8.2.00.0040.00417.98
8.1.280.0070.00725.92
8.1.270.0080.00823.77
8.1.260.0000.00828.09
8.1.250.0030.00628.09
8.1.240.0030.00619.09
8.1.230.0040.00717.83
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0000.00917.48
8.1.190.0030.00517.23
8.1.180.0060.00318.10
8.1.170.0080.00318.57
8.1.160.0070.00020.82
8.1.150.0030.00518.91
8.1.140.0040.00419.58
8.1.130.0030.00317.77
8.1.120.0050.00317.54
8.1.110.0040.00417.36
8.1.100.0030.00517.47
8.1.90.0020.00517.42
8.1.80.0050.00317.38
8.1.70.0000.00717.48
8.1.60.0080.00017.56
8.1.50.0000.00817.53
8.1.40.0000.00817.54
8.1.30.0000.00917.70
8.1.20.0050.00317.59
8.1.10.0080.00017.61
8.1.00.0050.00217.54
8.0.300.0000.00718.77
8.0.290.0030.00516.75
8.0.280.0030.00318.52
8.0.270.0000.00717.23
8.0.260.0070.00017.28
8.0.250.0000.00817.06
8.0.240.0000.00716.91
8.0.230.0000.00717.08
8.0.220.0000.00717.00
8.0.210.0040.00316.89
8.0.200.0030.00317.05
8.0.190.0000.00717.00
8.0.180.0070.00017.00
8.0.170.0000.00817.05
8.0.160.0070.00016.88
8.0.150.0030.00316.85
8.0.140.0040.00417.00
8.0.130.0000.00613.45
8.0.120.0040.00416.83
8.0.110.0000.00717.00
8.0.100.0040.00416.76
8.0.90.0080.00016.77
8.0.80.0090.00617.04
8.0.70.0080.00017.05
8.0.60.0070.00016.97
8.0.50.0040.00416.81
8.0.30.0080.01217.01
8.0.20.0070.01317.40
8.0.10.0040.00417.16
8.0.00.0110.00816.86
7.4.330.0000.00616.70
7.4.320.0030.00316.62
7.4.300.0030.00316.50
7.4.290.0000.00916.52
7.4.280.0000.00716.54
7.4.270.0000.00716.63
7.4.260.0070.00216.43
7.4.250.0060.00316.57
7.4.240.0020.00516.63
7.4.230.0070.00016.43
7.4.220.0150.00416.55
7.4.210.0000.01816.68
7.4.200.0000.00716.41
7.4.160.0060.01616.61
7.4.150.0070.01117.40
7.4.140.0070.01717.86
7.4.130.0110.00916.62
7.4.120.0160.00216.61
7.4.110.0150.00816.36
7.4.100.0150.00916.39
7.4.90.0040.01216.60
7.4.80.0120.00919.39
7.4.70.0070.01116.60
7.4.60.0150.00416.66
7.4.50.0090.00516.69
7.4.40.0070.01116.54
7.4.30.0090.00916.48
7.4.00.0110.00714.80
7.3.330.0000.00613.30
7.3.320.0080.00013.38
7.3.310.0070.00016.48
7.3.300.0030.00316.21
7.3.290.0080.00916.40
7.3.280.0100.00716.40
7.3.270.0140.00317.40
7.3.260.0030.01416.45
7.3.250.0100.01116.49
7.3.240.0090.00916.40
7.3.230.0000.01916.39
7.3.210.0110.00816.55
7.3.200.0140.00416.53
7.3.190.0040.01216.39
7.3.180.0090.00916.35
7.3.170.0130.00316.41
7.3.160.0100.00716.61
7.3.10.0110.00415.93
7.3.00.0110.00316.23
7.2.330.0140.00516.34
7.2.320.0070.01316.36
7.2.310.0130.01016.65
7.2.300.0070.01016.72
7.2.290.0160.00316.85
7.2.130.0170.00716.23
7.2.120.0050.00516.57
7.2.110.0070.00716.36
7.2.100.0270.00016.75
7.2.90.0070.01116.57
7.2.80.0130.00317.07
7.2.70.0210.00816.62
7.2.60.0100.00716.95
7.2.50.0130.00416.25
7.2.40.0110.00616.61
7.2.30.0060.00616.96
7.2.20.0000.01216.78
7.2.10.0060.00616.55
7.2.00.0090.00218.18
7.1.250.0110.00415.59
7.1.200.0060.00615.95
7.1.100.0090.00017.93
7.1.70.0000.00717.02
7.1.60.0130.01019.27
7.1.50.0170.02434.86
7.1.00.0030.07722.28
7.0.200.0420.00314.82
7.0.60.0130.03021.74
7.0.50.0070.04717.90
7.0.40.0030.04320.13
7.0.30.0200.04320.13
7.0.20.0370.07320.09
7.0.10.0070.08720.33
7.0.00.0000.04720.20
5.6.280.0070.03320.79
5.6.210.0170.07020.54
5.6.200.0100.07318.16
5.6.190.0070.07320.61
5.6.180.0170.04320.50
5.6.170.0370.07320.54
5.6.160.0130.03720.45
5.6.150.0030.04018.27
5.6.140.0070.06318.23
5.6.130.0070.08318.29
5.6.120.0230.06721.11
5.6.110.0130.06320.90
5.6.100.0070.08320.90
5.6.90.0130.07720.98
5.6.80.0130.07720.41
5.5.350.0200.03720.38
5.5.340.0170.06317.94
5.5.330.0070.05020.28
5.5.320.0370.07320.25
5.5.310.0270.08020.51
5.5.300.0170.07018.08
5.5.290.0130.04317.95
5.5.280.0030.04020.74
5.5.270.0100.07320.89
5.5.260.0070.08720.75
5.5.250.0130.07720.71
5.5.240.0030.07020.16

preferences:
52.18 ms | 401 KiB | 5 Q