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.0150.00418.68
8.3.50.0080.00818.18
8.3.40.0110.00418.79
8.3.30.0070.00718.87
8.3.20.0000.00820.35
8.3.10.0040.00420.61
8.3.00.0080.00020.49
8.2.180.0070.01316.50
8.2.170.0000.01522.96
8.2.160.0070.00722.27
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0080.00020.85
8.2.110.0110.00022.22
8.2.100.0080.00419.89
8.2.90.0000.00717.95
8.2.80.0080.00417.97
8.2.70.0040.00417.93
8.2.60.0000.00718.09
8.2.50.0040.00418.10
8.2.40.0000.00821.01
8.2.30.0040.00419.36
8.2.20.0040.00417.74
8.2.10.0000.00718.05
8.2.00.0040.00418.05
8.1.280.0110.00325.92
8.1.270.0000.00820.60
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0030.00622.17
8.1.230.0000.01122.76
8.1.220.0090.00017.74
8.1.210.0060.00318.77
8.1.200.0110.00017.35
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0000.00820.76
8.1.160.0040.00419.00
8.1.150.0040.00418.82
8.1.140.0040.00419.56
8.1.130.0030.00317.71
8.1.120.0000.00717.48
8.1.110.0000.00717.45
8.1.100.0070.00017.35
8.1.90.0000.00717.37
8.1.80.0000.00717.37
8.1.70.0040.00417.52
8.1.60.0000.00717.55
8.1.50.0030.00617.41
8.1.40.0080.00017.43
8.1.30.0040.00417.59
8.1.20.0030.00517.54
8.1.10.0000.00817.50
8.1.00.0000.00817.52
8.0.300.0040.00419.73
8.0.290.0000.00716.75
8.0.280.0070.00018.44
8.0.270.0030.00317.17
8.0.260.0000.00717.25
8.0.250.0000.00717.02
8.0.240.0070.00016.97
8.0.230.0000.00716.99
8.0.220.0030.00316.84
8.0.210.0050.00216.94
8.0.200.0000.00717.04
8.0.190.0040.00416.94
8.0.180.0000.00716.82
8.0.170.0040.00416.98
8.0.160.0040.00416.89
8.0.150.0080.00016.92
8.0.140.0040.00416.79
8.0.130.0000.00513.39
8.0.120.0000.00816.96
8.0.110.0030.00516.98
8.0.100.0040.00416.75
8.0.90.0000.00816.82
8.0.80.0140.00316.90
8.0.70.0050.00216.70
8.0.60.0000.00716.82
8.0.50.0060.00316.92
8.0.30.0120.00316.83
8.0.20.0090.01017.40
8.0.10.0000.00717.03
8.0.00.0080.01016.76
7.4.330.0060.00016.84
7.4.320.0030.00316.61
7.4.300.0040.00416.51
7.4.290.0000.00916.52
7.4.280.0040.00416.50
7.4.270.0030.00316.43
7.4.260.0080.00216.61
7.4.250.0000.00816.32
7.4.240.0030.00516.66
7.4.230.0000.00716.55
7.4.220.0070.01016.62
7.4.210.0000.01416.50
7.4.200.0070.00016.64
7.4.160.0060.01016.53
7.4.150.0110.00717.40
7.4.140.0110.00817.86
7.4.130.0070.01016.52
7.4.120.0070.00916.66
7.4.110.0060.01216.31
7.4.100.0060.01316.47
7.4.90.0070.01116.59
7.4.80.0090.02119.39
7.4.70.0130.01216.66
7.4.60.0100.01016.65
7.4.50.0030.01616.33
7.4.40.0100.00716.50
7.4.30.0090.00916.50
7.4.00.0030.01414.71
7.3.330.0000.00613.27
7.3.320.0000.00613.26
7.3.310.0040.00416.39
7.3.300.0000.00716.15
7.3.290.0090.00616.27
7.3.280.0060.01116.31
7.3.270.0160.00317.40
7.3.260.0040.01316.54
7.3.250.0090.00816.32
7.3.240.0110.00816.38
7.3.230.0090.00916.53
7.3.210.0110.01116.61
7.3.200.0110.00516.43
7.3.190.0080.01216.41
7.3.180.0150.00016.25
7.3.170.0100.00616.51
7.3.160.0100.00816.29
7.3.120.0000.01814.93
7.3.110.0000.01414.82
7.3.100.0090.00314.70
7.3.90.0030.01014.64
7.3.80.0060.00814.64
7.3.70.0040.01214.79
7.3.60.0040.01114.86
7.3.50.0000.01114.51
7.3.40.0030.01014.82
7.3.30.0050.00514.78
7.3.20.0120.00316.71
7.3.10.0110.00416.71
7.3.00.0000.01516.72
7.2.330.0070.01016.82
7.2.320.0150.01316.73
7.2.310.0070.01816.70
7.2.300.0060.00916.45
7.2.290.0110.00516.32
7.2.240.0000.01615.32
7.2.230.0000.01415.32
7.2.220.0000.01514.82
7.2.210.0060.00614.90
7.2.200.0070.00415.05
7.2.190.0130.00315.06
7.2.180.0060.00914.95
7.2.170.0040.01115.23
7.2.160.0060.00615.19
7.2.150.0070.00717.14
7.2.140.0000.01516.93
7.2.130.0070.01017.00
7.2.120.0030.01017.02
7.2.110.0040.00716.82
7.2.100.0050.00916.89
7.2.90.0090.00516.78
7.2.80.0030.00816.95
7.2.70.0100.00317.01
7.2.60.0070.00716.86
7.2.50.0050.00816.86
7.2.40.0050.00816.98
7.2.30.0080.00517.00
7.2.20.0040.01316.97
7.2.10.0040.00716.98
7.2.00.0060.00417.54
7.1.330.0030.00915.79
7.1.320.0090.00315.74
7.1.310.0070.00715.82
7.1.300.0030.01015.45
7.1.290.0060.00615.81
7.1.280.0070.00715.46
7.1.270.0100.00315.82
7.1.260.0120.00315.83
7.1.250.0000.01515.75
7.1.230.0030.00715.52
7.1.220.0030.01015.89
7.1.210.0040.01115.54
7.1.200.0050.00715.74
7.1.190.0090.00315.63
7.1.180.0090.00015.71
7.1.170.0000.01215.86
7.1.160.0030.00915.53
7.1.150.0040.01215.82
7.1.140.0070.00715.93
7.1.130.0100.00316.05
7.1.120.0080.00315.89
7.1.110.0030.01215.89
7.1.100.0040.00916.83
7.1.90.0110.00315.89
7.1.80.0030.00715.80
7.1.70.0070.00316.52
7.1.60.0150.00617.67
7.1.50.0110.00625.38
7.1.40.0030.00915.55
7.1.30.0070.00715.99
7.1.20.0040.01115.79
7.1.10.0090.00615.55
7.1.00.0020.04419.04
7.0.310.0000.01315.46
7.0.300.0060.00315.53
7.0.290.0090.00315.33
7.0.280.0000.01415.46
7.0.270.0040.00715.44
7.0.260.0040.00815.39
7.0.250.0060.00315.13
7.0.240.0060.00615.13
7.0.230.0040.00415.17
7.0.220.0030.00715.47
7.0.210.0030.01015.17
7.0.200.0130.00515.29
7.0.190.0040.00715.36
7.0.180.0100.00315.44
7.0.170.0040.00415.16
7.0.160.0090.00015.35
7.0.150.0030.00315.19
7.0.140.0040.00415.36
7.0.130.0080.00315.51
7.0.120.0030.00615.48
7.0.110.0060.00615.13
7.0.100.0040.00415.50
7.0.90.0070.00415.44
7.0.80.0060.01015.37
7.0.70.0120.00015.39
7.0.60.0030.02218.65
7.0.50.0030.02516.68
7.0.40.0080.02016.77
7.0.30.0080.02716.82
7.0.20.0200.04016.88
7.0.10.0090.04516.81
7.0.00.0030.02616.74
5.6.380.0070.00714.24
5.6.370.0080.00314.11
5.6.360.0040.00714.18
5.6.350.0120.00014.39
5.6.340.0090.00313.87
5.6.330.0050.00514.38
5.6.320.0090.00314.32
5.6.310.0060.00313.75
5.6.300.0030.00714.18
5.6.290.0060.00314.36
5.6.280.0080.00413.93
5.6.270.0060.00614.08
5.6.260.0110.00014.03
5.6.250.0030.00714.11
5.6.240.0070.00714.04
5.6.230.0040.01114.34
5.6.220.0040.00914.33
5.6.210.0060.04617.24
5.6.200.0090.04215.99
5.6.190.0080.04317.22
5.6.180.0140.02717.15
5.6.170.0190.04417.35
5.6.160.0080.04317.32
5.6.150.0080.04816.16
5.6.140.0070.03016.10
5.6.130.0100.03816.27
5.6.120.0030.02517.61
5.6.110.0060.04317.59
5.6.100.0110.04117.48
5.6.90.0100.04117.60
5.6.80.0050.02017.24
5.6.70.0000.01414.21
5.6.60.0030.00914.09
5.6.50.0100.00314.00
5.6.40.0060.00613.95
5.6.30.0100.00614.19
5.6.20.0030.00614.13
5.6.10.0070.00714.11
5.6.00.0030.00914.05
5.5.380.0000.01110.79
5.5.370.0060.00011.24
5.5.360.0000.00910.72
5.5.350.0130.02215.54
5.5.340.0060.02614.41
5.5.330.0050.02515.53
5.5.320.0190.03215.64
5.5.310.0140.04315.50
5.5.300.0070.02714.34
5.5.290.0050.03414.54
5.5.280.0050.03515.88
5.5.270.0050.02215.97
5.5.260.0050.04315.77
5.5.250.0030.04315.77
5.5.240.0010.02515.51
5.5.230.0000.00810.91
5.5.220.0070.00310.94
5.5.210.0030.00710.87
5.5.200.0000.01110.98
5.5.190.0040.00810.87
5.5.180.0030.00310.75
5.5.170.0060.00613.84
5.5.160.0070.00011.02
5.5.150.0030.00711.05
5.5.140.0030.00910.73
5.5.130.0030.00710.73
5.5.120.0040.00410.69
5.5.110.0000.01211.01
5.5.100.0060.00610.71
5.5.90.0100.00010.88
5.5.80.0040.00810.63
5.5.70.0040.00410.60
5.5.60.0030.00610.75
5.5.50.0040.00410.83
5.5.40.0040.00410.79
5.5.30.0030.00610.96
5.5.20.0030.00610.89
5.5.10.0070.00011.01
5.5.00.0080.00410.82

preferences:
59.28 ms | 401 KiB | 5 Q