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();

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.70.0090.00918.43
8.3.60.0090.00616.88
8.3.50.0130.00521.98
8.3.40.0040.01118.80
8.3.30.0090.00918.70
8.3.20.0040.00420.16
8.3.10.0060.00323.65
8.3.00.0030.00619.38
8.2.180.0110.01116.50
8.2.170.0070.00722.96
8.2.160.0100.00622.12
8.2.150.0110.00424.18
8.2.140.0040.00424.66
8.2.130.0100.00019.23
8.2.120.0070.00026.35
8.2.110.0090.00019.24
8.2.100.0080.00417.97
8.2.90.0040.00419.25
8.2.80.0080.00017.97
8.2.70.0050.01117.35
8.2.60.0040.00417.80
8.2.50.0030.00618.07
8.2.40.0050.00219.37
8.2.30.0070.00020.68
8.2.20.0080.00017.67
8.2.10.0050.00218.14
8.2.00.0040.00417.99
8.1.280.0160.00325.92
8.1.270.0060.00322.19
8.1.260.0070.00028.09
8.1.250.0070.00028.09
8.1.240.0090.00021.24
8.1.230.0060.00617.51
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0060.00317.47
8.1.190.0050.00317.35
8.1.180.0030.00518.10
8.1.170.0060.00320.42
8.1.160.0000.00722.06
8.1.150.0040.00418.77
8.1.140.0030.00519.61
8.1.130.0050.00317.71
8.1.120.0000.00717.40
8.1.110.0040.00417.41
8.1.100.0000.00917.36
8.1.90.0000.00817.49
8.1.80.0000.00817.48
8.1.70.0030.00317.31
8.1.60.0050.00317.52
8.1.50.0080.00017.51
8.1.40.0030.00517.53
8.1.30.0030.00617.68
8.1.20.0060.00317.72
8.1.10.0000.00817.46
8.1.00.0040.00417.39
8.0.300.0000.00818.77
8.0.290.0040.00416.75
8.0.280.0040.00418.31
8.0.270.0040.00417.34
8.0.260.0000.00617.26
8.0.250.0000.00716.89
8.0.240.0000.00816.95
8.0.230.0070.00017.05
8.0.220.0030.00316.86
8.0.210.0030.00416.97
8.0.200.0030.00316.89
8.0.190.0100.00016.98
8.0.180.0060.00316.95
8.0.170.0030.00517.00
8.0.160.0050.00316.97
8.0.150.0000.00716.91
8.0.140.0000.01016.87
8.0.130.0000.00613.41
8.0.120.0050.00216.89
8.0.110.0070.00016.99
8.0.100.0000.00717.00
8.0.90.0050.00216.93
8.0.80.0060.01016.91
8.0.70.0040.00416.77
8.0.60.0020.00516.78
8.0.50.0030.00516.99
8.0.30.0120.00517.01
8.0.20.0110.01217.40
8.0.10.0070.00017.03
8.0.00.0060.01216.75
7.4.330.0030.00316.67
7.4.320.0000.00616.51
7.4.300.0060.00016.51
7.4.290.0040.00416.51
7.4.280.0090.00016.58
7.4.270.0030.00316.64
7.4.260.0070.00016.57
7.4.250.0030.00516.46
7.4.240.0020.00516.49
7.4.230.0000.00716.50
7.4.220.0100.01316.52
7.4.210.0080.00616.68
7.4.200.0040.00416.71
7.4.160.0120.00616.48
7.4.150.0120.00617.40
7.4.140.0160.00517.86
7.4.130.0130.00416.47
7.4.120.0100.00716.61
7.4.110.0180.00016.50
7.4.100.0160.00316.55
7.4.90.0090.00916.51
7.4.80.0070.01119.39
7.4.70.0070.01116.67
7.4.60.0130.00616.47
7.4.50.0030.01316.64
7.4.40.0090.00916.66
7.4.30.0100.00716.69
7.4.00.0100.00714.64
7.3.330.0000.00513.23
7.3.320.0050.00013.19
7.3.310.0000.00716.18
7.3.300.0000.00716.39
7.3.290.0070.00916.37
7.3.280.0080.00816.35
7.3.270.0140.00417.40
7.3.260.0090.00916.63
7.3.250.0090.01016.37
7.3.240.0110.01016.48
7.3.230.0130.00416.63
7.3.210.0100.00716.48
7.3.200.0160.00016.34
7.3.190.0070.01016.63
7.3.180.0090.00916.44
7.3.170.0140.00716.43
7.3.160.0070.01016.34
7.2.330.0140.00616.35
7.2.320.0100.00716.63
7.2.310.0100.01316.75
7.2.300.0180.00016.70
7.2.290.0130.00916.88
7.2.60.0140.00516.97
7.1.200.0070.00715.78
7.1.70.0040.00417.06
7.1.60.0100.01419.48
7.1.50.0100.00716.89
7.1.00.0030.07722.31
7.0.200.1240.00014.78
7.0.100.0100.07719.88
7.0.90.0100.06319.97
7.0.80.0100.08319.93
7.0.70.0330.05719.99
7.0.60.0300.07719.86
7.0.50.0070.03720.25
7.0.40.0100.04720.10
7.0.30.0070.08319.95
7.0.20.0070.08319.96
7.0.10.0000.09020.15
7.0.00.0200.04719.91
5.6.280.0070.06321.13
5.6.250.0000.05320.50
5.6.240.0070.06320.65
5.6.230.0030.09320.63
5.6.220.0070.04720.63
5.6.210.0100.08020.77
5.6.200.0100.09021.06
5.6.190.0070.08021.17
5.6.180.0070.03721.11
5.6.170.0070.07721.11
5.6.160.0100.06320.96
5.6.150.0030.08020.96
5.6.140.0170.07721.07
5.6.130.0030.05021.04
5.6.120.0100.07021.08
5.6.110.0030.04321.07
5.6.100.0070.06721.01
5.6.90.0130.07321.14
5.6.80.0100.08020.49
5.6.70.0100.07720.49
5.6.60.0070.05020.51
5.6.50.0170.03020.46
5.6.40.0070.04720.36
5.6.30.0130.07720.29
5.6.20.0100.07720.39
5.6.10.0130.05720.37
5.6.00.0130.08020.38
5.5.380.0100.07320.43
5.5.370.0030.08320.53
5.5.360.0030.05320.42
5.5.350.0100.08020.41
5.5.340.0030.04720.93
5.5.330.0130.07720.92
5.5.320.0030.08320.81
5.5.310.0070.08020.88
5.5.300.0170.07320.84
5.5.290.0070.06320.83
5.5.280.0000.06320.73
5.5.270.0030.08320.86
5.5.260.0070.06720.87
5.5.250.0070.04720.69
5.5.240.0100.07320.27
5.5.230.0030.07320.31
5.5.220.0130.04320.02
5.5.210.0170.07020.29
5.5.200.0000.06720.24
5.5.190.0070.07720.16
5.5.180.0030.07020.28
5.5.160.0030.06020.27
5.5.150.0070.04320.21
5.5.140.0130.07320.17
5.5.130.0130.03020.26
5.5.120.0170.07020.27
5.5.110.0130.07719.97
5.5.100.0170.07320.02
5.5.90.0030.06720.17
5.5.80.0070.08020.12
5.5.70.0070.06320.05
5.5.60.0100.06720.08
5.5.50.0130.04319.96
5.5.40.0130.03720.06
5.5.30.0030.08320.13
5.5.20.0100.08020.11
5.5.10.0200.06320.12
5.5.00.0130.07320.02

preferences:
55.21 ms | 401 KiB | 5 Q