3v4l.org

run code in 300+ PHP versions simultaneously
<?hh namespace A { class T {} } namespace { class Test { public function first(string $str) : Closure { /* closure with return type declaration and use() clause */ $tmp = function() : int use ($str) { return strlen($str); }; return $tmp; } public function second() : self { return $this; } } class SubTest extends Test { public function third() : parent { return $this; } /* returning a namespace-qualified type */ public function fourth() : \A\T { return new \A\T; } /* spaces are allowed around elements of the namespace */ public function fifth() : \ A \ T { return $this->fourth(); } } $s = new SubTest; $t = $s->third(); var_dump(($t->second()->first("hello"))()); var_dump($s->fourth()); var_dump($s->fifth()); }

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.0090.00616.25
8.3.50.0070.01321.92
8.3.40.0070.01018.73
8.3.30.0090.00618.45
8.3.20.0030.00520.21
8.3.10.0080.00023.71
8.3.00.0080.00023.73
8.2.180.0040.01518.41
8.2.170.0120.00322.96
8.2.160.0070.00720.39
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00021.00
8.2.120.0080.00026.35
8.2.110.0090.00020.25
8.2.100.0040.00717.78
8.2.90.0000.00819.22
8.2.80.0000.00817.97
8.2.70.0050.00317.36
8.2.60.0030.00517.80
8.2.50.0030.00518.07
8.2.40.0050.00322.32
8.2.30.0030.00620.55
8.2.20.0000.00717.55
8.2.10.0040.00417.99
8.2.00.0040.00417.78
8.1.280.0070.01025.92
8.1.270.0120.00320.38
8.1.260.0000.00728.09
8.1.250.0040.00428.09
8.1.240.0090.00023.97
8.1.230.0060.00617.42
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0060.00317.10
8.1.190.0040.00417.00
8.1.180.0050.00218.10
8.1.170.0050.00318.59
8.1.160.0040.00420.63
8.1.150.0070.00018.67
8.1.140.0040.00419.43
8.1.130.0000.00717.47
8.1.120.0040.00417.21
8.1.110.0060.00317.21
8.1.100.0040.00417.20
8.1.90.0080.00017.37
8.1.80.0000.00717.39
8.1.70.0030.00317.21
8.1.60.0070.00017.45
8.1.50.0060.00317.38
8.1.40.0000.00717.30
8.1.30.0040.00417.43
8.1.20.0020.00517.42
8.1.10.0050.00217.40
8.1.00.0080.00017.38
8.0.300.0080.00018.77
8.0.290.0040.00416.63
8.0.280.0000.00718.34
8.0.270.0030.00317.12
8.0.260.0000.00617.12
8.0.250.0000.00616.83
8.0.240.0030.00316.81
8.0.230.0050.00216.86
8.0.220.0070.00016.73
8.0.210.0000.00816.66
8.0.200.0030.00316.81
8.0.190.0030.00616.84
8.0.180.0040.00416.69
8.0.170.0040.00416.82
8.0.160.0040.00416.80
8.0.150.0040.00416.69
8.0.140.0000.00716.71
8.0.130.0030.00313.43
8.0.120.0030.00516.70
8.0.110.0080.00016.75
8.0.100.0000.00716.71
8.0.90.0040.00416.75
8.0.80.0070.01016.69
8.0.70.0000.00716.76
8.0.60.0000.00716.57
8.0.50.0070.00016.71
8.0.30.0100.00716.78
8.0.20.0120.00917.40
8.0.10.0040.00416.88
8.0.00.0150.00416.61
7.4.330.0000.00516.81
7.4.320.0030.00316.55
7.4.300.0000.00716.46
7.4.290.0000.00716.27
7.4.280.0050.00316.36
7.4.270.0040.00416.27
7.4.260.0030.00316.40
7.4.250.0000.00816.43
7.4.240.0050.00216.40
7.4.230.0070.00016.58
7.4.220.0070.01316.49
7.4.210.0070.00716.45
7.4.200.0000.00716.54
7.4.160.0080.00816.25
7.4.150.0130.00617.40
7.4.140.0070.01317.86
7.4.130.0110.00816.30
7.4.120.0030.01416.53
7.4.110.0090.00916.20
7.4.100.0040.01316.23
7.4.90.0100.01016.46
7.4.80.0090.00919.39
7.4.70.0050.01616.37
7.4.60.0130.00316.51
7.4.50.0070.00716.41
7.4.40.0060.01016.19
7.4.30.0080.00816.37
7.3.330.0050.00013.14
7.3.320.0000.00513.25
7.3.310.0030.00315.99
7.3.300.0030.00316.20
7.3.290.0040.01116.10
7.3.280.0070.00916.13
7.3.270.0120.00617.40
7.3.260.0070.01016.38
7.3.250.0120.00616.41
7.3.240.0130.00416.31
7.3.230.0110.00516.39
7.3.210.0040.01416.17
7.3.200.0120.00416.14
7.3.190.0080.00816.29
7.3.180.0030.01216.58
7.3.170.0120.00916.31
7.3.160.0090.00616.19
7.2.330.0110.00716.37
7.2.320.0060.01016.19
7.2.310.0130.00916.57
7.2.300.0070.01016.49
7.2.290.0100.00716.23
7.0.00.0070.04020.09
5.6.160.0200.05320.43
5.6.150.0030.07018.18
5.6.140.0130.05018.28
5.6.130.0070.07318.19
5.6.120.0030.04020.98
5.6.110.0100.08021.11
5.6.100.0100.07721.04
5.6.90.0030.04021.02
5.6.80.0130.07320.47
5.5.300.0070.04318.08
5.5.290.0100.04318.05
5.5.280.0130.06320.80
5.5.270.0000.04720.88
5.5.260.0070.08320.95
5.5.250.0030.08320.70
5.5.240.0270.07720.13

preferences:
47.79 ms | 401 KiB | 5 Q