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->fifth(); } } $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.0100.01016.75
8.3.50.0120.00316.21
8.3.40.0100.00718.58
8.3.30.0120.00318.72
8.3.20.0040.00422.09
8.3.10.0080.00023.52
8.3.00.0050.00323.63
8.2.180.0120.00318.42
8.2.170.0070.00722.96
8.2.160.0030.01020.29
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00019.19
8.2.120.0040.00426.35
8.2.110.0030.00620.13
8.2.100.0090.00317.72
8.2.90.0000.00719.09
8.2.80.0080.00017.97
8.2.70.0000.00817.50
8.2.60.0030.00517.80
8.2.50.0050.00318.07
8.2.40.0030.00522.15
8.2.30.0030.00720.66
8.2.20.0000.00817.58
8.2.10.0000.00817.77
8.2.00.0070.00017.89
8.1.280.0060.00925.92
8.1.270.0100.01020.30
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0100.00023.92
8.1.230.0040.00817.42
8.1.220.0050.00317.74
8.1.210.0060.00318.77
8.1.200.0060.00317.23
8.1.190.0040.00417.10
8.1.180.0090.00018.10
8.1.170.0030.00518.58
8.1.160.0050.00320.61
8.1.150.0070.00018.83
8.1.140.0000.00819.49
8.1.130.0030.00317.60
8.1.120.0000.00717.38
8.1.110.0020.00517.22
8.1.100.0000.00717.27
8.1.90.0070.00017.34
8.1.80.0040.00417.27
8.1.70.0000.00717.19
8.1.60.0000.00817.46
8.1.50.0050.00317.45
8.1.40.0080.00017.29
8.1.30.0060.00317.50
8.1.20.0020.00517.52
8.1.10.0080.00017.30
8.1.00.0060.00317.27
8.0.300.0050.00218.77
8.0.290.0000.00716.75
8.0.280.0000.00718.31
8.0.270.0070.00017.18
8.0.260.0030.00317.09
8.0.250.0000.00716.91
8.0.240.0030.00316.84
8.0.230.0080.00016.95
8.0.220.0000.00716.88
8.0.210.0030.00316.91
8.0.200.0040.00416.79
8.0.190.0040.00416.84
8.0.180.0000.00816.87
8.0.170.0040.00416.80
8.0.160.0040.00416.96
8.0.150.0050.00316.77
8.0.140.0040.00416.75
8.0.130.0000.00513.38
8.0.120.0000.00816.88
8.0.110.0000.00716.90
8.0.100.0080.00016.69
8.0.90.0040.00416.75
8.0.80.0110.00416.84
8.0.70.0070.00016.80
8.0.60.0000.00816.77
8.0.50.0000.00816.93
8.0.30.0100.00717.04
8.0.20.0090.01017.40
8.0.10.0000.00716.89
8.0.00.0090.01116.74
7.4.330.0070.01774.66
7.4.320.0160.01772.09
7.4.300.0240.01772.03
7.4.290.0190.01672.03
7.4.280.0260.01072.03
7.4.270.0210.01272.11
7.4.260.0160.02672.11
7.4.250.0210.01472.12
7.4.240.0150.01772.04
7.4.230.0310.00072.02
7.4.220.0970.01372.13
7.4.210.0640.00771.96
7.4.200.0160.01672.10
7.4.160.0630.01671.89
7.4.150.0610.02271.94
7.4.140.0760.04272.09
7.4.130.0480.03572.16
7.4.120.0600.02072.11
7.4.110.0480.03671.90
7.4.100.0610.02572.07
7.4.90.0540.03071.98
7.4.80.0550.03672.02
7.4.70.0580.04871.96
7.4.60.0630.01772.14
7.4.50.0310.01572.16
7.4.40.0610.03472.06
7.4.30.0530.02872.03
7.4.00.0290.02370.65
7.3.330.0560.013121.64
7.3.320.0510.019121.71
7.3.310.0190.01271.77
7.3.300.0240.01071.87
7.3.290.0530.03271.90
7.3.280.0470.03071.93
7.3.270.0650.02372.04
7.3.260.0670.01572.00
7.3.250.0550.02971.95
7.3.240.0590.03772.01
7.3.230.0580.02672.00
7.3.210.0320.04871.96
7.3.200.0530.03372.21
7.3.190.0470.04171.95
7.3.180.0530.02771.63
7.3.170.0600.02371.78
7.3.160.0380.04572.09
7.2.330.1250.05872.30
7.2.320.0810.02772.23
7.2.310.0520.03272.25
7.2.300.0770.03372.21
7.2.290.0540.03272.09
7.2.60.1790.02978.66
7.2.00.5730.01679.62
7.1.200.1830.02877.80
7.1.102.4660.02770.56
7.1.70.1220.01479.10
7.1.60.0260.03379.13
7.1.50.0300.03078.62
7.1.00.0130.08784.45
7.0.200.6610.01072.75
7.0.60.0330.05375.53
7.0.50.0370.08373.50
7.0.40.0100.06720.26
7.0.30.0330.08020.13
7.0.20.0300.05720.07
7.0.10.0100.05020.30
7.0.00.0100.10320.14
5.6.280.0000.07320.86
5.6.210.0000.04720.70
5.6.200.0030.04718.18
5.6.190.0030.08320.48
5.6.180.0200.04720.77
5.6.170.0130.04720.71
5.6.160.0030.07320.50
5.6.150.0100.04018.29
5.6.140.0030.05318.18
5.6.130.0130.08018.21
5.6.120.0000.05021.14
5.6.110.0130.06721.00
5.6.100.0030.04020.96
5.6.90.0030.04021.00
5.6.80.0000.08720.51
5.5.350.0200.04020.38
5.5.340.0070.06018.09
5.5.330.0130.08020.57
5.5.320.0270.08320.38
5.5.310.0300.07320.25
5.5.300.0070.08017.94
5.5.290.0130.04718.08
5.5.280.0100.04020.80
5.5.270.0130.08020.76
5.5.260.0100.08020.84
5.5.250.0030.07320.79
5.5.240.0230.06320.19

preferences:
59.72 ms | 404 KiB | 6 Q