3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mimicking($obj, $exec){ 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.0150.00618.56
8.3.50.0140.00722.05
8.3.40.0040.01219.01
8.3.30.0170.00318.79
8.3.20.0080.00020.33
8.3.10.0040.00420.67
8.3.00.0060.00320.77
8.2.180.0060.01216.38
8.2.170.0110.00422.96
8.2.160.0070.00722.14
8.2.150.0030.00524.18
8.2.140.0030.00524.66
8.2.130.0050.00321.06
8.2.120.0040.00426.35
8.2.110.0030.00620.35
8.2.100.0090.00317.97
8.2.90.0040.00419.22
8.2.80.0000.00917.97
8.2.70.0040.00417.63
8.2.60.0040.00418.03
8.2.50.0040.00418.09
8.2.40.0030.00720.43
8.2.30.0000.00719.36
8.2.20.0000.00717.76
8.2.10.0040.00418.02
8.2.00.0040.00417.96
8.1.280.0040.01125.92
8.1.270.0040.00423.92
8.1.260.0030.00528.09
8.1.250.0030.00628.09
8.1.240.0090.00622.48
8.1.230.0110.00022.69
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0080.00017.35
8.1.180.0000.00818.10
8.1.170.0050.00518.64
8.1.160.0050.00220.84
8.1.150.0050.00218.83
8.1.140.0000.00819.65
8.1.130.0070.00017.63
8.1.120.0000.00717.51
8.1.110.0000.00717.46
8.1.100.0070.00017.46
8.1.90.0030.00317.49
8.1.80.0000.00817.50
8.1.70.0060.00317.52
8.1.60.0020.00517.49
8.1.50.0040.00417.57
8.1.40.0040.00417.38
8.1.30.0000.00817.57
8.1.20.0080.00017.52
8.1.10.0000.00717.64
8.1.00.0080.00017.58
8.0.300.0080.00018.77
8.0.290.0050.00316.75
8.0.280.0040.00418.39
8.0.270.0040.00417.27
8.0.260.0030.00317.23
8.0.250.0030.00616.88
8.0.240.0070.00016.89
8.0.230.0070.00016.93
8.0.220.0070.00016.84
8.0.210.0030.00316.87
8.0.200.0060.00017.05
8.0.190.0030.00316.98
8.0.180.0040.00416.89
8.0.170.0040.00416.97
8.0.160.0040.00416.93
8.0.150.0000.00816.91
8.0.140.0000.00716.95
8.0.130.0000.00613.32
8.0.120.0030.00616.96
8.0.110.0030.00516.97
8.0.100.0070.00016.96
8.0.90.0000.00816.94
8.0.80.0060.00917.01
8.0.70.0000.00716.73
8.0.60.0040.00416.76
8.0.50.0040.00416.76
8.0.30.0070.01017.30
8.0.20.0090.01017.40
8.0.10.0080.00016.89
8.0.00.0130.00516.62
7.4.330.0050.00016.80
7.4.320.0000.00616.52
7.4.300.0070.00016.56
7.4.290.0040.00416.52
7.4.280.0000.00716.50
7.4.270.0000.00716.53
7.4.260.0080.00016.62
7.4.250.0000.00716.60
7.4.240.0050.00216.49
7.4.230.0000.00816.54
7.4.220.0120.00616.69
7.4.210.0070.00716.48
7.4.200.0070.00016.59
7.4.160.0090.00916.49
7.4.150.0160.00317.40
7.4.140.0080.01317.86
7.4.130.0180.00316.47
7.4.120.0120.00816.50
7.4.110.0040.01416.51
7.4.100.0140.00716.60
7.4.90.0100.00716.70
7.4.80.0120.00619.39
7.4.70.0130.00416.44
7.4.60.0060.00916.71
7.4.50.0070.00716.47
7.4.40.0100.00616.37
7.4.30.0070.01016.64
7.4.00.0050.01215.07
7.3.330.0020.00213.39
7.3.320.0030.00313.23
7.3.310.0050.00216.30
7.3.300.0070.00016.33
7.3.290.0080.00816.39
7.3.280.0080.00916.33
7.3.270.0090.01217.40
7.3.260.0090.00916.34
7.3.240.0080.01016.38
7.3.230.0180.00316.39
7.3.210.0100.00716.43
7.3.200.0100.00616.63
7.3.190.0100.00616.35
7.3.180.0140.00316.36
7.3.170.0090.00916.44
7.3.160.0120.00616.38
7.3.120.0070.00714.93
7.3.110.0090.00914.75
7.3.100.0000.01714.88
7.3.90.0000.01015.09
7.3.80.0100.00314.84
7.3.70.0040.00414.48
7.3.60.0090.00314.91
7.3.50.0140.00014.47
7.3.40.0060.00314.83
7.3.30.0070.00714.96
7.3.20.0120.00316.68
7.3.10.0060.00616.79
7.3.00.0040.00416.73
7.2.330.0070.01116.30
7.2.320.0120.01216.64
7.2.310.0140.00316.52
7.2.300.0120.00916.53
7.2.290.0090.00616.50
7.2.250.0130.00315.27
7.2.240.0100.01015.05
7.2.230.0040.01115.25
7.2.220.0070.00714.99
7.2.210.0070.00714.97
7.2.200.0060.00614.88
7.2.190.0080.00414.71
7.2.180.0040.01214.99
7.2.170.0110.00315.04
7.2.110.0200.00316.48
7.2.60.0090.00616.78
7.2.00.0060.01019.11
7.1.330.0040.01115.65
7.1.320.0090.00315.96
7.1.310.0070.00715.88
7.1.300.0100.00015.84
7.1.290.0000.01415.63
7.1.280.0030.00515.73
7.1.270.0060.00615.72
7.1.260.0070.01015.54
7.1.200.0000.01215.62
7.1.100.0000.00918.23
7.1.70.0030.00517.09
7.1.60.0130.01319.27
7.1.50.0070.01417.05
7.1.00.0030.07322.33
7.0.200.0340.00314.69
7.0.60.0070.07721.66
7.0.50.0070.03717.94
7.0.40.0000.04720.27
7.0.30.0300.05720.25
7.0.20.0200.05720.09
7.0.10.0000.05020.13
7.0.00.0070.04020.10
5.6.280.0000.04021.08
5.6.210.0030.06020.52
5.6.200.0070.05718.14
5.6.190.0130.06020.57
5.6.180.0130.04720.63
5.6.170.0300.07720.47
5.6.160.0030.08020.39
5.6.150.0000.05018.29
5.6.140.0130.07018.11
5.6.130.0000.08718.18
5.6.120.0030.04020.99
5.6.110.0030.05720.97
5.6.100.0100.06720.96
5.6.90.0070.08720.98
5.6.80.0030.03720.30
5.5.350.0330.07320.33
5.5.340.0100.06718.09
5.5.330.0030.06020.40
5.5.320.0270.05720.30
5.5.310.0170.08020.35
5.5.300.0070.08017.98
5.5.290.0130.07717.98
5.5.280.0070.04320.75
5.5.270.0100.04020.85
5.5.260.0200.07020.64
5.5.250.0070.08020.61
5.5.240.0030.06720.27

preferences:
59.77 ms | 401 KiB | 5 Q