3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { private $p = 'secret'; function RetVal(){ return $this->p; } } class y { private $q = 'queen'; function RetValue() { return $this->q; } } $f = function() { return (new x)->RetVal(); }; echo $f(),"\n"; $g = function(){ return $this->p; }; $nu = $g->bindto((new x), "x"); echo $nu(),"\n"; echo $g->call((new x)); $ff = function() use(&$g) { return $g(); }; echo $ff->call((new y));

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.40.0040.01118.80
8.3.30.0030.01218.87
8.3.20.0000.00720.33
8.3.10.0050.00323.64
8.3.00.0050.00319.29
8.2.170.0070.01022.96
8.2.160.0100.00322.09
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0000.00819.48
8.2.120.0080.00026.35
8.2.110.0060.00320.16
8.2.100.0120.00017.93
8.2.90.0000.00819.13
8.2.80.0050.00317.97
8.2.70.0080.00417.63
8.2.60.0060.00318.04
8.2.50.0050.00318.07
8.2.40.0000.00719.08
8.2.30.0000.00720.63
8.2.20.0080.00017.67
8.2.10.0050.00218.14
8.2.00.0000.00718.03
8.1.270.0090.00022.18
8.1.260.0040.00428.09
8.1.250.0090.00028.09
8.1.240.0070.00320.66
8.1.230.0120.00017.64
8.1.220.0020.00517.74
8.1.210.0000.00818.77
8.1.200.0000.00917.48
8.1.190.0000.00817.36
8.1.180.0050.00318.10
8.1.170.0100.00018.66
8.1.160.0000.00722.07
8.1.150.0000.00818.84
8.1.140.0000.00819.47
8.1.130.0070.00017.71
8.1.120.0000.00717.51
8.1.110.0040.00417.46
8.1.100.0040.00417.36
8.1.90.0040.00417.55
8.1.80.0030.00617.41
8.1.70.0000.00717.43
8.1.60.0030.00617.56
8.1.50.0040.00417.56
8.1.40.0080.00017.51
8.1.30.0000.00817.60
8.1.20.0080.00017.70
8.1.10.0050.00217.59
8.1.00.0000.00817.53
8.0.300.0050.00218.77
8.0.290.0040.00416.75
8.0.280.0070.00018.37
8.0.270.0000.00717.28
8.0.260.0060.00017.20
8.0.250.0040.00417.02
8.0.240.0050.00317.02
8.0.230.0040.00417.05
8.0.220.0000.00717.00
8.0.210.0070.00016.85
8.0.200.0030.00317.04
8.0.190.0030.00616.93
8.0.180.0100.00016.95
8.0.170.0030.00516.84
8.0.160.0050.00516.97
8.0.150.0050.00316.92
8.0.140.0030.00616.73
8.0.130.0030.00313.41
8.0.120.0040.00416.95
8.0.110.0030.00316.80
8.0.100.0040.00416.84
8.0.90.0040.00416.95
8.0.80.0070.00716.92
8.0.70.0040.00416.80
8.0.60.0070.00016.74
8.0.50.0030.00516.84
8.0.30.0090.01117.04
8.0.20.0140.00617.40
8.0.10.0030.00516.99
8.0.00.0080.00916.81
7.4.330.0000.00516.84
7.4.320.0060.00016.56
7.4.300.0030.00316.41
7.4.290.0070.00016.36
7.4.280.0000.00816.60
7.4.270.0060.00016.44
7.4.260.0030.00316.63
7.4.250.0040.00416.55
7.4.240.0050.00316.52
7.4.230.0030.00316.50
7.4.220.0090.00916.52
7.4.210.0070.00716.48
7.4.200.0030.00316.57
7.4.160.0060.00916.47
7.4.150.0100.00717.40
7.4.140.0080.01117.86
7.4.130.0100.00716.56
7.4.120.0130.01016.62
7.4.110.0080.01216.61
7.4.100.0140.01116.39
7.4.90.0130.00516.66
7.4.80.0120.00619.39
7.4.70.0090.00916.50
7.4.60.0100.01316.48
7.4.50.0030.01016.41
7.4.40.0090.00916.66
7.4.30.0060.01716.47
7.4.00.0080.00915.04
7.3.330.0000.00513.45
7.3.320.0000.00613.33
7.3.310.0000.00616.37
7.3.300.0000.00716.38
7.3.290.0070.00816.34
7.3.280.0080.01116.34
7.3.270.0110.00717.40
7.3.260.0030.01316.60
7.3.250.0080.00916.38
7.3.240.0070.01416.53
7.3.230.0120.00916.42
7.3.210.0040.01216.50
7.3.200.0170.00216.41
7.3.190.0100.00716.42
7.3.180.0110.01016.48
7.3.170.0120.01116.52
7.3.160.0030.01216.52
7.3.120.0040.01514.92
7.3.110.0030.01414.57
7.3.100.0040.01114.71
7.3.90.0100.01014.91
7.3.80.0070.00714.57
7.3.70.0090.00314.64
7.3.60.0030.00914.63
7.3.50.0090.00914.74
7.3.40.0070.00714.59
7.3.30.0000.01214.63
7.3.20.0070.00716.40
7.3.10.0070.00716.68
7.3.00.0070.00716.60
7.2.330.0090.01216.86
7.2.320.0140.00316.43
7.2.310.0060.01416.50
7.2.300.0140.00316.81
7.2.290.0100.00716.87
7.2.250.0040.01415.19
7.2.240.0030.01615.15
7.2.230.0170.00315.18
7.2.220.0100.01014.90
7.2.210.0030.01614.96
7.2.200.0140.00015.18
7.2.190.0100.00715.18
7.2.180.0070.01115.01
7.2.170.0120.00315.14
7.2.60.0060.00616.52
7.2.00.0140.00719.37
7.1.330.0030.01015.59
7.1.320.0100.00315.59
7.1.310.0030.01515.82
7.1.300.0100.00315.79
7.1.290.0000.01415.74
7.1.280.0030.01015.74
7.1.270.0030.01015.74
7.1.260.0040.00715.70
7.1.200.0030.00715.56
7.1.100.0100.00718.29
7.1.70.0050.00517.15
7.1.60.0110.01419.48
7.1.50.0040.00816.93
7.1.00.0030.07322.35
7.0.200.0460.00414.80
7.0.60.0100.08020.07
7.0.50.0030.05017.95
7.0.40.0170.08020.02
7.0.30.0200.04320.21
7.0.20.0270.08320.10
7.0.10.0030.07320.25
7.0.00.0100.06020.26
5.6.210.0070.05320.66
5.6.200.0070.05318.29
5.6.190.0070.08020.64
5.6.180.0670.04720.61
5.6.170.0370.07720.51
5.6.160.0100.07020.54
5.6.150.0100.07318.23
5.6.140.0000.04318.28
5.6.130.0070.05318.14
5.6.120.0030.09021.15
5.6.110.0100.07321.00
5.6.100.0130.05021.09
5.6.90.0030.08720.97
5.6.80.0030.04020.45
5.5.350.4130.04020.39
5.5.340.0270.06017.93
5.5.330.0030.05020.40
5.5.320.0270.06320.28
5.5.310.0370.07320.37
5.5.300.0100.07018.00
5.5.290.0030.08317.98
5.5.280.0100.04720.98
5.5.270.0100.08020.81
5.5.260.0030.06020.98
5.5.250.0130.07020.71
5.5.240.0200.06320.16

preferences:
42.81 ms | 400 KiB | 5 Q