3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mimicking($obj, Closure $exec){ $thisVal = (new ReflectionFunction($exec))->getClosureThis(); return ($exec)->bindTo($thisVal, $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.0170.00718.55
8.3.50.0160.00322.11
8.3.40.0150.00018.87
8.3.30.0040.01118.70
8.3.20.0000.00820.25
8.3.10.0080.00020.48
8.3.00.0050.00320.64
8.2.180.0090.00916.50
8.2.170.0120.00322.96
8.2.160.0070.00722.08
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00021.00
8.2.120.0080.00026.35
8.2.110.0100.00019.27
8.2.100.0040.00817.91
8.2.90.0000.00920.07
8.2.80.0030.00618.03
8.2.70.0040.00417.91
8.2.60.0040.00417.93
8.2.50.0040.00418.10
8.2.40.0040.00420.59
8.2.30.0040.00419.32
8.2.20.0040.00417.61
8.2.10.0040.00418.03
8.2.00.0040.00417.94
8.1.280.0090.00625.92
8.1.270.0090.00923.92
8.1.260.0080.00028.09
8.1.250.0040.00428.09
8.1.240.0040.00920.75
8.1.230.0040.00722.67
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0030.00617.35
8.1.190.0030.00617.23
8.1.180.0060.00318.10
8.1.170.0040.00418.66
8.1.160.0000.00822.17
8.1.150.0050.00218.80
8.1.140.0040.00419.66
8.1.130.0000.00717.62
8.1.120.0000.00817.48
8.1.110.0050.00317.47
8.1.100.0080.00017.42
8.1.90.0000.00817.50
8.1.80.0030.00517.32
8.1.70.0070.00017.38
8.1.60.0000.00917.63
8.1.50.0030.00617.50
8.1.40.0000.00817.43
8.1.30.0030.00517.57
8.1.20.0000.00817.39
8.1.10.0070.00017.48
8.1.00.0030.00617.48
8.0.300.0000.00819.97
8.0.290.0000.00816.75
8.0.280.0000.00718.48
8.0.270.0000.00717.18
8.0.260.0000.00617.22
8.0.250.0040.00416.91
8.0.240.0040.00417.01
8.0.230.0070.00016.92
8.0.220.0070.00016.99
8.0.210.0000.00716.96
8.0.200.0000.00717.01
8.0.190.0070.00016.96
8.0.180.0030.00416.93
8.0.170.0000.00817.04
8.0.160.0000.00716.96
8.0.150.0050.00316.92
8.0.140.0000.00716.89
8.0.130.0000.00513.42
8.0.120.0080.00016.90
8.0.110.0050.00216.89
8.0.100.0040.00416.82
8.0.90.0070.00016.88
8.0.80.0040.01116.88
8.0.70.0040.00416.96
8.0.60.0040.00416.97
8.0.50.0050.00316.98
8.0.30.0080.00817.23
8.0.20.0110.01017.40
8.0.10.0070.00017.14
8.0.00.0110.00716.72
7.4.330.0050.00016.68
7.4.320.0030.00316.50
7.4.300.0060.00016.58
7.4.290.0000.00816.42
7.4.280.0030.00616.64
7.4.270.0030.00316.60
7.4.260.0040.00416.58
7.4.250.0040.00416.43
7.4.240.0080.00016.57
7.4.230.0030.00316.34
7.4.220.0110.00716.51
7.4.210.0110.00316.64
7.4.200.0070.00016.50
7.4.160.0060.01416.46
7.4.150.0070.01417.40
7.4.140.0070.01217.86
7.4.130.0110.00716.43
7.4.120.0140.00916.55
7.4.110.0040.01416.38
7.4.100.0110.00816.65
7.4.90.0080.00816.46
7.4.80.0070.01419.39
7.4.70.0100.00716.48
7.4.60.0110.00516.44
7.4.50.0090.00616.18
7.4.40.0060.00916.37
7.4.30.0140.00316.48
7.4.00.0070.01014.92
7.3.330.0000.00613.09
7.3.320.0070.00013.26
7.3.310.0070.00016.33
7.3.300.0070.00016.25
7.3.290.0070.00716.28
7.3.280.0080.00816.29
7.3.270.0070.01017.40
7.3.260.0150.00916.63
7.3.250.0100.00816.32
7.3.240.0120.00916.38
7.3.230.0100.00716.39
7.3.210.0130.00716.31
7.3.200.0130.00616.46
7.3.190.0070.01016.32
7.3.180.0080.01216.27
7.3.170.0100.00616.59
7.3.160.0050.01316.39
7.3.120.0030.01014.74
7.3.110.0000.01514.74
7.3.100.0070.00714.60
7.3.90.0120.00314.95
7.3.80.0000.01014.82
7.3.70.0030.00914.88
7.3.60.0060.00314.95
7.3.50.0050.00514.54
7.3.40.0060.00914.71
7.3.30.0000.01114.95
7.3.20.0130.00316.54
7.3.10.0090.00616.50
7.3.00.0000.01816.83
7.2.330.0090.00916.61
7.2.320.0080.01616.69
7.2.310.0100.00716.71
7.2.300.0060.01016.77
7.2.290.0090.00616.87
7.2.240.0000.00815.22
7.2.230.0000.01614.99
7.2.220.0070.00715.21
7.2.210.0080.00815.25
7.2.200.0090.00615.21
7.2.190.0030.01315.04
7.2.180.0030.01415.15
7.2.170.0000.01715.23
7.2.160.0040.01214.82
7.2.150.0100.00716.72
7.2.140.0090.00616.91
7.2.130.0070.01117.01
7.2.120.0090.00616.99
7.2.110.0100.00717.13
7.2.100.0060.00617.05
7.2.90.0100.00317.07
7.2.80.0030.01516.92
7.2.70.0110.00417.02
7.2.60.0080.00716.76
7.2.50.0140.00016.89
7.2.40.0000.01516.71
7.2.30.0070.01016.95
7.2.20.0030.00916.87
7.2.10.0060.00916.99
7.2.00.0050.01018.03
7.1.330.0040.00815.69
7.1.320.0070.01015.98
7.1.310.0080.00815.70
7.1.300.0040.01115.59
7.1.290.0080.00615.80
7.1.280.0060.01015.68
7.1.270.0070.00715.57
7.1.260.0040.00715.47
7.1.250.0000.01615.94
7.1.200.0000.00715.73
7.1.100.0030.00918.25
7.1.70.0060.00317.28
7.1.60.0130.01019.27
7.1.50.0130.00334.94
7.1.00.0030.07722.57
7.0.200.0270.00314.99
7.0.60.0030.03321.75
7.0.50.0000.04317.87
7.0.40.0070.04020.11
7.0.30.0270.07020.30
7.0.20.0270.04720.23
7.0.10.0000.06320.09
7.0.00.0000.04320.09
5.6.280.0000.03720.87
5.6.210.0100.06320.61
5.6.200.0000.08718.23
5.6.190.0100.08020.39
5.6.180.0230.03720.55
5.6.170.0370.08020.47
5.6.160.0070.07020.46
5.6.150.0000.04318.18
5.6.140.0000.08718.18
5.6.130.0130.07718.23
5.6.120.0100.07021.05
5.6.110.0200.07320.89
5.6.100.0100.07721.05
5.6.90.0070.08720.98
5.6.80.0030.04020.44
5.5.350.0200.03020.33
5.5.340.0070.06718.07
5.5.330.0030.07320.40
5.5.320.0270.06020.27
5.5.310.0230.05020.19
5.5.300.0000.04718.07
5.5.290.0030.09017.97
5.5.280.0030.09020.88
5.5.270.0030.08020.74
5.5.260.0130.08020.68
5.5.250.0070.07720.58
5.5.240.0000.04020.07

preferences:
58.15 ms | 401 KiB | 5 Q