3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mimicking($obj, $exec){ return (function() use($exec){ return $exec(); })->bindTo($obj, 'A')(); } 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.01518.55
8.3.50.0160.00318.04
8.3.40.0090.00618.84
8.3.30.0110.00418.92
8.3.20.0070.00020.33
8.3.10.0080.00020.28
8.3.00.0000.00820.71
8.2.180.0140.00716.63
8.2.170.0110.00722.96
8.2.160.0030.01322.30
8.2.150.0000.01624.18
8.2.140.0040.00424.66
8.2.130.0040.00421.04
8.2.120.0070.00026.35
8.2.110.0000.01119.33
8.2.100.0040.00817.93
8.2.90.0040.00419.26
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0040.00418.04
8.2.50.0030.00618.09
8.2.40.0050.00320.59
8.2.30.0040.00419.41
8.2.20.0000.00717.82
8.2.10.0040.00417.95
8.2.00.0000.00717.98
8.1.280.0130.00325.92
8.1.270.0070.00023.96
8.1.260.0060.00328.09
8.1.250.0050.00328.09
8.1.240.0060.00322.19
8.1.230.0060.00617.77
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0000.00817.36
8.1.180.0040.00418.10
8.1.170.0000.00918.72
8.1.160.0040.00420.69
8.1.150.0000.00818.92
8.1.140.0000.00819.55
8.1.130.0040.00417.71
8.1.120.0030.00317.53
8.1.110.0050.00317.49
8.1.100.0000.00717.41
8.1.90.0000.00717.55
8.1.80.0000.00717.45
8.1.70.0030.00617.46
8.1.60.0040.00417.59
8.1.50.0060.00317.52
8.1.40.0070.00317.54
8.1.30.0030.00517.61
8.1.20.0040.00417.42
8.1.10.0040.00417.66
8.1.00.0000.00817.49
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0070.00018.45
8.0.270.0030.00317.30
8.0.260.0000.00617.27
8.0.250.0030.00616.96
8.0.240.0050.00216.99
8.0.230.0030.00317.01
8.0.220.0000.00916.86
8.0.210.0040.00416.85
8.0.200.0000.00617.06
8.0.190.0030.00616.92
8.0.180.0070.00016.87
8.0.170.0000.00817.00
8.0.160.0070.00016.88
8.0.150.0080.00016.89
8.0.140.0070.00016.90
8.0.130.0050.00013.35
8.0.120.0070.00016.91
8.0.110.0040.00416.86
8.0.100.0040.00416.91
8.0.90.0000.00716.80
8.0.80.0140.00716.93
8.0.70.0040.00416.90
8.0.60.0040.00416.84
8.0.50.0080.00016.98
8.0.30.0120.00417.17
8.0.20.0110.00817.40
8.0.10.0000.00717.06
8.0.00.0120.00516.79
7.4.330.0030.00316.76
7.4.320.0000.00716.61
7.4.300.0070.00016.50
7.4.290.0030.00316.61
7.4.280.0060.00316.55
7.4.270.0030.00316.57
7.4.260.0000.00816.63
7.4.250.0000.00816.49
7.4.240.0000.00716.54
7.4.230.0000.00716.59
7.4.220.0070.01016.52
7.4.210.0040.01216.71
7.4.200.0000.00816.62
7.4.160.0030.01316.38
7.4.150.0090.00917.40
7.4.140.0150.00917.86
7.4.130.0100.00816.70
7.4.120.0070.01016.52
7.4.110.0030.01916.42
7.4.100.0130.00916.70
7.4.90.0100.00616.47
7.4.80.0110.01119.39
7.4.70.0100.00716.58
7.4.60.0080.00816.37
7.4.50.0110.00416.47
7.4.40.0080.00816.36
7.4.30.0090.00916.31
7.4.00.0140.00015.16
7.3.330.0000.00713.31
7.3.320.0030.00313.19
7.3.310.0070.00016.41
7.3.300.0030.00316.37
7.3.290.0080.00716.38
7.3.280.0070.01116.38
7.3.270.0030.01517.40
7.3.260.0100.00716.44
7.3.250.0070.01116.42
7.3.240.0100.00816.44
7.3.230.0090.00916.43
7.3.210.0120.00416.50
7.3.200.0070.01016.50
7.3.190.0090.00816.36
7.3.180.0080.00816.39
7.3.170.0060.01516.65
7.3.160.0090.00616.40
7.2.330.0090.01016.68
7.2.320.0120.00616.71
7.2.310.0060.01216.66
7.2.300.0070.01016.79
7.2.290.0110.00616.65
7.2.60.0070.00716.94
7.2.00.0030.01219.56
7.1.200.0000.00915.61
7.1.100.0040.01218.09
7.1.70.0000.00717.24
7.1.60.0040.01819.27
7.1.50.0110.01116.69
7.1.00.0100.07022.44
7.0.200.0430.00414.88
7.0.60.0030.04021.84
7.0.50.0000.04317.90
7.0.40.0070.07320.18
7.0.30.0200.04020.23
7.0.20.0170.04320.02
7.0.10.0070.07020.23
7.0.00.0030.05320.24
5.6.280.0000.06020.81
5.6.210.0070.08320.51
5.6.200.0000.08718.23
5.6.190.0130.08320.42
5.6.180.0330.07320.65
5.6.170.0330.03720.39
5.6.160.0100.08320.46
5.6.150.0070.06718.27
5.6.140.0030.05018.28
5.6.130.0130.07718.14
5.6.120.0030.08020.99
5.6.110.0100.08321.12
5.6.100.0030.08721.04
5.6.90.0030.06721.04
5.6.80.0000.04020.54
5.5.350.0270.04020.41
5.5.340.0100.06717.99
5.5.330.0100.07320.34
5.5.320.0270.05320.30
5.5.310.0300.06320.27
5.5.300.0070.07318.07
5.5.290.0070.05018.08
5.5.280.0100.08320.77
5.5.270.0030.04020.89
5.5.260.0130.06720.88
5.5.250.0430.05320.59
5.5.240.0130.03720.36

preferences:
47.48 ms | 401 KiB | 5 Q