3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Item { private $id; public function __construct(int $id) { $this->id = $id; } public function id() : int { return $this->id; } } class Collection extends IteratorIterator { public function __construct(Item ...$items) { parent::__construct( (function() use ($items) { yield from $items; })() ); } public function current() : Item { return parent::current(); } } $items = []; for ($i=0; $i<10; $i++) { $items[] = new Item($i); } $collection = new Collection(...$items); foreach ($collection as $item) { printf("\tClass: %s. Calling id() method returns %d (%s)\n", get_class($item), $item->id(), gettype($item->id())); }

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.4.120.0120.00822.00
8.4.110.0110.00222.48
8.4.100.0150.00617.71
8.4.90.0050.00618.96
8.4.80.0120.00517.78
8.4.70.0080.01417.66
8.4.60.0120.00918.83
8.4.50.0130.00817.77
8.4.40.0210.00019.34
8.4.30.0120.00917.50
8.4.20.0140.00717.68
8.4.10.0100.00017.59
8.3.250.0100.00518.82
8.3.240.0110.00516.29
8.3.230.0130.00616.70
8.3.220.0060.00317.49
8.3.210.0110.00416.80
8.3.200.0050.00416.58
8.3.190.0090.00619.15
8.3.180.0060.00216.35
8.3.170.0000.01417.27
8.3.160.0090.00918.15
8.3.150.0090.00622.59
8.3.140.0100.00016.88
8.3.130.0040.00418.51
8.3.120.0030.00620.91
8.3.110.0070.00420.94
8.3.100.0110.00718.35
8.3.90.0030.00516.48
8.3.80.0030.00618.43
8.3.70.0120.00316.50
8.3.60.0060.00918.30
8.3.50.0080.01022.04
8.3.40.0160.00319.31
8.3.30.0080.01018.87
8.3.20.0030.01221.03
8.3.10.0110.00421.24
8.3.00.0040.00919.84
8.2.290.0060.00220.20
8.2.280.0110.00818.34
8.2.270.0160.00316.50
8.2.260.0100.00719.05
8.2.250.0040.00416.73
8.2.240.0060.00319.16
8.2.230.0090.00322.58
8.2.220.0090.00024.06
8.2.210.0140.00026.77
8.2.200.0070.00316.88
8.2.190.0150.00616.58
8.2.180.0120.00318.54
8.2.170.0100.00520.96
8.2.160.0110.00620.14
8.2.150.0060.00621.73
8.2.140.0060.00622.55
8.2.130.0060.00619.89
8.2.120.0090.00322.88
8.2.110.0100.00319.92
8.2.100.0110.00318.51
8.2.90.0050.00819.06
8.2.80.0100.00218.70
8.2.70.0080.00418.16
8.2.60.0050.00718.41
8.2.50.0000.01318.64
8.2.40.0080.00519.63
8.2.30.0070.00619.97
8.2.20.0050.00718.29
8.2.10.0090.00318.43
8.2.00.0050.00718.49
8.1.330.0110.00822.10
8.1.320.0110.01015.84
8.1.310.0040.00416.94
8.1.300.0060.00316.36
8.1.290.0030.00618.88
8.1.280.0120.00325.92
8.1.270.0100.00222.90
8.1.260.0080.00425.07
8.1.250.0030.00825.07
8.1.240.0120.00021.17
8.1.230.0020.01119.73
8.1.220.0080.00318.29
8.1.210.0070.00718.69
8.1.200.0070.00618.20
8.1.190.0140.00018.02
8.1.180.0060.00818.28
8.1.170.0120.00118.63
8.1.160.0070.00720.62
8.1.150.0090.00418.81
8.1.140.0050.00819.16
8.1.130.0070.00418.24
8.1.120.0040.00917.94
8.1.110.0060.00617.93
8.1.100.0060.00618.63
8.1.90.0090.00318.09
8.1.80.0060.00618.52
8.1.70.0060.00518.07
8.1.60.0060.00518.07
8.1.50.0060.00618.06
8.1.40.0090.00318.13
8.1.30.0060.00618.37
8.1.20.0090.00318.78
8.1.10.0110.00018.18
8.1.00.0080.00417.97
8.0.300.0080.00418.23
8.0.290.0090.00917.19
8.0.280.0130.00318.02
8.0.270.0080.00517.57
8.0.260.0150.00317.54
8.0.250.0140.00517.43
8.0.240.0190.00017.27
8.0.230.0100.00517.26
8.0.220.0150.00117.30
8.0.210.0100.00717.24
8.0.200.0110.00717.43
8.0.190.0100.01017.41
8.0.180.0140.00617.40
8.0.170.0140.00317.35
8.0.160.0090.00917.42
8.0.150.0160.00517.39
8.0.140.0120.00617.21
8.0.130.0140.00215.53
8.0.120.0170.00417.43
8.0.110.0100.00917.35
8.0.100.0080.00917.19
8.0.90.0050.00917.13
8.0.80.0120.00717.19
8.0.70.0060.00417.15
8.0.60.0110.00417.11
8.0.50.0080.00617.14
8.0.30.0100.00517.21
8.0.20.0110.00817.37
8.0.10.0100.00717.25
8.0.00.0100.00817.30
7.4.330.0110.00817.09
7.4.320.0180.00316.96
7.4.300.0190.00416.94
7.4.290.0130.00916.95
7.4.280.0150.00416.98
7.4.270.0120.00716.99
7.4.260.0160.00416.90
7.4.250.0190.00216.93
7.4.240.0210.00217.03
7.4.230.0140.00717.04
7.4.220.0190.00516.77
7.4.210.0130.00716.88
7.4.200.0070.00916.78
7.4.190.0190.00317.11
7.4.180.0170.00517.15
7.4.160.0130.00716.88
7.4.150.0170.00517.09
7.4.140.0130.00917.39
7.4.130.0140.00616.72
7.4.120.0110.00816.66
7.4.110.0140.00616.73
7.4.100.0150.00516.85
7.4.90.0140.00716.79
7.4.80.0140.00617.74
7.4.70.0090.01016.86
7.4.60.0130.00616.88
7.4.50.0090.00716.81
7.4.40.0160.00916.71
7.4.30.0150.00416.89
7.4.20.0170.00216.98
7.4.10.0140.00516.88
7.4.00.0130.00616.38
7.3.330.0140.00615.33
7.3.320.0120.00815.28
7.3.310.0140.00616.86
7.3.300.0170.00317.05
7.3.290.0100.01016.52
7.3.280.0090.01216.51
7.3.270.0140.00617.00
7.3.260.0130.00916.57
7.3.250.0160.00416.54
7.3.240.0100.01116.61
7.3.230.0110.01016.64
7.3.220.0130.00516.84
7.3.210.0170.00616.59
7.3.200.0100.00816.70
7.3.190.0150.00316.61
7.3.180.0140.00416.68
7.3.170.0150.00616.83
7.3.160.0130.00616.61
7.3.150.0120.00616.68
7.3.140.0130.00516.87
7.3.130.0150.00316.83
7.3.120.0110.00516.05
7.3.110.0110.00516.05
7.3.100.0110.00415.94
7.3.90.0110.00715.90
7.3.80.0130.00415.80
7.3.70.0090.00816.13
7.3.60.0100.00515.77
7.3.50.0090.00715.92
7.3.40.0110.00715.73
7.3.30.0090.00715.80
7.3.20.0140.00516.33
7.3.10.0110.00616.29
7.3.00.0130.00316.32
7.2.340.0170.00316.83
7.2.330.0100.00916.72
7.2.320.0150.00316.89
7.2.310.0120.00716.82
7.2.300.0140.00716.77
7.2.290.0090.01016.79
7.2.280.0140.00616.90
7.2.270.0180.00316.75
7.2.260.0100.00816.78
7.2.250.0140.00416.74
7.2.240.0140.00416.01
7.2.230.0100.00615.95
7.2.220.0070.01016.03
7.2.210.0110.00516.04
7.2.200.0100.00816.06
7.2.190.0090.01015.95
7.2.180.0100.00815.98
7.2.170.0090.00916.17
7.2.160.0080.00916.11
7.2.150.0170.00516.60
7.2.140.0110.00516.54
7.2.130.0140.00316.50
7.2.120.0100.00816.59
7.2.110.0100.00616.71
7.2.100.0070.01116.63
7.2.90.0130.00316.60
7.2.80.0140.00616.53
7.2.70.0080.00916.61
7.2.60.0110.00616.64
7.2.50.0130.00716.61
7.2.40.0120.00616.65
7.2.30.0110.00516.54
7.2.20.0120.00516.73
7.2.10.0110.00816.61
7.2.00.0070.00816.64
7.1.330.0110.00715.45
7.1.320.0110.00615.53
7.1.310.0100.00515.39
7.1.300.0060.01015.42
7.1.290.0070.01015.41
7.1.280.0100.00515.53
7.1.270.0200.00415.77
7.1.260.0080.00815.44
7.1.250.0100.00615.40
7.1.240.0140.00315.23
7.1.230.0130.00415.35
7.1.220.0110.00615.15
7.1.210.0090.00715.21
7.1.200.0090.00715.46
7.1.190.0140.00315.06
7.1.180.0100.00715.21
7.1.170.0120.00515.22
7.1.160.0140.00515.53
7.1.150.0130.00715.14
7.1.140.0140.00515.28
7.1.130.0170.00215.29
7.1.120.0130.00515.30
7.1.110.0090.01015.24
7.1.100.1870.00915.44
7.1.90.1940.00415.60
7.1.80.1480.00715.53
7.1.70.0620.00915.62
7.1.60.0920.00719.19
7.1.50.1120.00919.38
7.1.40.0630.00819.02
7.1.30.0560.00819.04
7.1.20.0630.00719.04
7.1.10.0560.00615.43
7.1.00.0390.00815.48
7.0.330.0080.00914.98
7.0.320.0070.01115.04
7.0.310.0120.00514.93
7.0.300.0110.00714.99
7.0.290.0140.00515.03
7.0.280.0170.00414.96
7.0.270.0090.01214.96
7.0.260.0140.00815.05
7.0.250.0110.00914.96
7.0.240.1900.00315.18
7.0.230.1660.00615.31
7.0.220.1630.00715.23
7.0.210.0760.01014.89
7.0.200.1200.00715.26
7.0.190.0720.00715.30
7.0.180.0530.00515.08
7.0.170.0730.00715.16
7.0.160.0650.00615.16
7.0.150.0480.00715.10
7.0.140.0480.00915.16
7.0.130.0470.00615.22
7.0.120.0540.00615.23
7.0.110.0630.00715.41
7.0.100.0610.00715.20
7.0.90.0410.00815.15
7.0.80.0580.00715.19
7.0.70.0520.00715.12
7.0.60.0520.00515.15
7.0.50.0440.00715.13
7.0.40.0500.00814.92
7.0.30.0450.00914.96
7.0.20.0690.00614.91
7.0.10.0130.00714.95
7.0.00.0090.00814.80
5.6.400.0080.00915.37
5.6.390.0110.00715.34
5.6.380.0150.00715.43
5.6.370.0100.00815.52
5.6.360.0100.00515.27
5.6.350.0150.00115.26
5.6.340.0130.00315.47
5.6.330.0100.00615.34
5.6.320.0100.00615.42
5.6.310.0120.00615.33
5.6.300.0100.02817.51
5.6.290.0100.03117.56
5.6.280.0090.03017.67
5.6.270.0090.03317.56
5.6.260.0100.02817.57
5.6.250.0110.03217.56
5.6.240.0090.02817.61
5.6.230.0100.03317.54
5.6.220.0110.02517.56
5.6.210.0100.02817.58
5.6.200.0120.02417.65
5.6.190.0120.02117.68
5.6.180.0130.02117.57
5.6.170.0100.02617.49
5.6.160.0090.02617.55
5.6.150.0080.02917.65
5.6.140.0100.02517.49
5.6.130.0040.03217.50
5.6.120.0120.02317.50
5.6.110.0110.02517.58
5.6.100.0090.02617.53
5.6.90.0110.02617.63
5.6.80.0120.02317.31
5.6.70.0130.02217.19
5.6.60.0100.02217.33
5.6.50.0110.02117.27
5.6.40.0120.03217.34
5.6.30.0090.02917.19
5.6.20.0070.02917.35
5.6.10.0050.02917.24
5.6.00.0090.02617.25
5.5.380.0100.02716.18
5.5.370.0090.02716.30
5.5.360.0120.02216.22
5.5.350.0120.02116.13
5.5.340.0110.02116.24
5.5.330.0100.02516.20
5.5.320.0090.02416.33
5.5.310.0110.02316.36
5.5.300.0120.03116.28
5.5.290.0090.02916.36
5.5.280.0120.02016.29
5.5.270.0110.02716.29
5.5.260.0090.02816.42
5.5.250.0100.02616.32
5.5.240.0090.02616.14
5.5.230.0070.02916.19
5.5.220.0130.02216.04
5.5.210.0100.02616.14
5.5.200.0150.02416.07
5.5.190.0080.02916.14
5.5.180.0120.02416.17
5.5.170.0120.00215.23
5.5.160.0110.02416.00
5.5.150.0100.02316.04
5.5.140.0110.02516.06
5.5.130.0100.02516.08
5.5.120.0090.02616.01
5.5.110.0120.02315.98
5.5.100.0120.02516.05
5.5.90.0110.02116.08
5.5.80.0150.02315.97
5.5.70.0090.02716.03
5.5.60.0120.02216.09
5.5.50.0100.02316.09
5.5.40.0110.02416.12
5.5.30.0060.03216.03
5.5.20.0080.02716.16
5.5.10.0100.02616.16
5.5.00.0100.03215.94

preferences:
32.85 ms | 403 KiB | 5 Q