3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace A { class T {} } namespace { class Test { public function first(string $str) : Closure { /* closure with return type declaration and use() clause */ $tmp = function() use ($str) : int { 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(); } public function &sixth(\A\T &$t) : \A\T { return $t; } } /* runtime test */ $s = new SubTest; $t = $s->third(); var_dump(($t->second()->first("hello"))()); var_dump($s->fourth()); var_dump($s->fifth()); var_dump($s->sixth($s->fourth())); }

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.00316.63
8.3.50.0310.00621.21
8.3.40.0100.00718.71
8.3.30.0110.00318.54
8.3.20.0000.00820.38
8.3.10.0000.00823.52
8.3.00.0080.00023.45
8.2.180.0060.01218.41
8.2.170.0110.01122.96
8.2.160.0060.00620.52
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0030.00520.94
8.2.120.0000.00826.35
8.2.110.0030.00622.13
8.2.100.0040.00717.80
8.2.90.0000.00818.92
8.2.80.0000.00717.97
8.2.70.0050.00317.24
8.2.60.0060.00317.80
8.2.50.0040.00418.07
8.2.40.0070.00022.20
8.2.30.0040.00420.52
8.2.20.0040.00417.60
8.2.10.0000.00717.89
8.2.00.0000.00817.88
8.1.280.0110.00725.92
8.1.270.0000.00721.98
8.1.260.0070.00028.09
8.1.250.0000.00728.09
8.1.240.0060.00322.36
8.1.230.0070.00319.16
8.1.220.0030.00517.74
8.1.210.0080.00018.77
8.1.200.0040.00417.23
8.1.190.0050.00317.10
8.1.180.0070.00018.10
8.1.170.0040.00418.49
8.1.160.0060.00320.61
8.1.150.0040.00418.75
8.1.140.0040.00519.41
8.1.130.0030.00317.59
8.1.120.0000.00717.28
8.1.110.0030.00617.34
8.1.100.0030.00617.20
8.1.90.0040.00317.27
8.1.80.0050.00317.26
8.1.70.0030.00317.19
8.1.60.0000.00917.33
8.1.50.0040.00417.41
8.1.40.0000.00817.26
8.1.30.0030.00617.43
8.1.20.0000.00717.47
8.1.10.0020.00517.32
8.1.00.0000.00717.37
8.0.300.0050.00218.77
8.0.290.0000.00816.63
8.0.280.0030.00318.38
8.0.270.0030.00317.18
8.0.260.0070.00017.21
8.0.250.0030.00316.96
8.0.240.0000.00616.84
8.0.230.0000.00716.93
8.0.220.0050.00316.80
8.0.210.0000.00716.84
8.0.200.0000.00616.88
8.0.190.0060.00316.94
8.0.180.0040.00416.77
8.0.170.0040.00416.93
8.0.160.0000.00816.85
8.0.150.0020.00516.69
8.0.140.0030.00316.80
8.0.130.0000.00513.24
8.0.120.0040.00416.84
8.0.110.0040.00416.80
8.0.100.0050.00316.74
8.0.90.0000.00716.76
8.0.80.0110.00416.74
8.0.70.0030.00516.88
8.0.60.0000.00716.88
8.0.50.0020.00516.88
8.0.30.0070.01217.03
8.0.20.0120.00717.40
8.0.10.0050.00216.93
8.0.00.0130.00616.65
7.4.330.0030.00315.08
7.4.320.0000.00716.42
7.4.300.0000.00816.48
7.4.290.0030.00316.51
7.4.280.0030.00616.64
7.4.270.0030.00716.65
7.4.260.0040.00416.59
7.4.250.0060.00316.57
7.4.240.0020.00616.55
7.4.230.0000.00716.44
7.4.220.0100.00716.64
7.4.210.0100.00416.46
7.4.200.0000.00716.54
7.4.160.0090.00616.41
7.4.150.0170.00017.40
7.4.140.0160.00517.86
7.4.130.0060.01116.50
7.4.120.0090.00816.50
7.4.110.0140.00316.46
7.4.100.0060.01016.50
7.4.90.0070.01016.58
7.4.80.0060.01919.39
7.4.70.0100.00716.53
7.4.60.0070.01716.37
7.4.50.0040.01116.57
7.4.40.0130.00316.49
7.4.30.0090.01316.53
7.4.00.0070.00814.84
7.3.330.0030.00313.27
7.3.320.0050.00313.40
7.3.310.0000.00716.47
7.3.300.0030.00316.46
7.3.290.0090.01016.45
7.3.280.0060.01016.47
7.3.270.0070.01017.40
7.3.260.0090.01516.43
7.3.250.0100.00816.37
7.3.240.0070.01016.50
7.3.230.0100.01016.39
7.3.210.0140.01116.53
7.3.200.0080.00816.45
7.3.190.0100.00716.65
7.3.180.0070.00716.49
7.3.170.0120.01116.43
7.3.160.0160.00016.36
7.3.120.0120.00414.94
7.3.110.0070.00715.17
7.3.100.0100.00314.86
7.3.90.0120.00315.12
7.3.80.0000.01414.85
7.3.70.0000.01314.97
7.3.60.0000.01114.89
7.3.50.0030.00914.69
7.3.40.0060.00314.95
7.3.30.0090.00614.70
7.3.20.0000.01116.63
7.3.10.0080.00416.71
7.3.00.0090.00616.81
7.2.330.0060.01216.35
7.2.320.0100.00716.77
7.2.310.0120.00416.54
7.2.300.0070.01116.42
7.2.290.0130.03616.66
7.2.250.0060.00915.00
7.2.240.0160.00615.14
7.2.230.0000.01215.26
7.2.220.0080.00815.24
7.2.210.0000.01415.09
7.2.200.0100.00015.20
7.2.190.0000.01315.14
7.2.180.0040.01115.25
7.2.170.0030.01015.19
7.2.130.0040.01216.98
7.2.120.0060.00616.88
7.2.110.0000.01117.03
7.2.100.0060.00617.04
7.2.90.0070.00717.08
7.2.80.0060.00916.40
7.2.70.0030.01216.92
7.2.60.0030.00816.90
7.2.50.0030.00717.00
7.2.40.0070.00417.05
7.2.30.0130.00016.81
7.2.20.0000.01216.95
7.2.10.0000.01416.80
7.2.00.0120.00316.60
7.1.330.0040.00815.93
7.1.320.0040.01215.95
7.1.310.0030.01015.72
7.1.300.0080.00615.76
7.1.290.0060.00615.61
7.1.280.0090.00315.77
7.1.270.0030.01015.61
7.1.260.0090.00615.65
7.1.250.0070.00315.85
7.1.200.0100.00015.85
7.1.100.0040.01118.29
7.1.70.0100.00016.90
7.1.60.0070.01819.52
7.1.50.0040.00817.00
7.1.00.0030.07722.44
7.0.200.0030.00316.69
7.0.60.0030.04020.05
7.0.50.0000.04317.85
7.0.40.0100.05320.10
7.0.30.0300.07320.23
7.0.20.0200.09020.10
7.0.10.0170.07320.24
7.0.00.0070.09020.18
5.6.280.0100.04721.11
5.6.210.0100.08320.51
5.6.200.0130.07318.11
5.6.190.0030.04320.46
5.6.180.0230.07720.55
5.6.170.0270.07720.50
5.6.160.0030.08720.47
5.6.150.0070.08018.23
5.6.140.0130.06718.18
5.6.130.0100.08018.16
5.6.120.0030.06321.00
5.6.110.0030.09021.14
5.6.100.0070.04021.04
5.6.90.0070.05721.06
5.6.80.0130.06720.48
5.5.350.4030.04020.38
5.5.340.0030.08718.08
5.5.330.0100.07320.22
5.5.320.0600.07020.29
5.5.310.0130.04720.51
5.5.300.0030.03717.98
5.5.290.0000.04317.97
5.5.280.0130.08320.66
5.5.270.0070.07720.88
5.5.260.0170.06320.96
5.5.250.0100.07720.55
5.5.240.0100.04020.19

preferences:
40.78 ms | 401 KiB | 5 Q