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 ArrayIterator { 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.3.70.0170.00718.43
8.3.60.0090.01218.56
8.3.50.0300.00522.89
8.3.40.0120.00318.93
8.3.30.0110.00418.44
8.3.20.0070.00020.39
8.3.10.0080.00020.46
8.3.00.0080.00020.55
8.2.190.0110.01116.58
8.2.180.0120.00618.13
8.2.170.0040.01122.96
8.2.160.0150.00020.43
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00420.89
8.2.120.0040.00426.16
8.2.110.0090.00019.21
8.2.100.0000.01117.93
8.2.90.0080.00019.23
8.2.80.0050.00317.97
8.2.70.0040.00417.75
8.2.60.0040.00417.93
8.2.50.0080.00018.09
8.2.40.0050.00320.59
8.2.30.0070.00019.49
8.2.20.0070.00017.65
8.2.10.0040.00417.99
8.2.00.0080.00017.98
8.1.280.0090.00625.92
8.1.270.0090.00023.91
8.1.260.0050.00226.35
8.1.250.0000.00828.09
8.1.240.0030.00622.48
8.1.230.0060.00617.71
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0000.00917.47
8.1.190.0060.00319.01
8.1.180.0060.00318.10
8.1.170.0050.00318.48
8.1.160.0040.00420.72
8.1.150.0000.00720.71
8.1.140.0080.00019.51
8.1.130.0030.00317.70
8.1.120.0000.00717.35
8.1.110.0000.00817.52
8.1.100.0040.00417.52
8.1.90.0000.00717.43
8.1.80.0000.00817.39
8.1.70.0030.00317.46
8.1.60.0040.00417.56
8.1.50.0030.00517.54
8.1.40.0040.00417.55
8.1.30.0060.00317.62
8.1.20.0090.00017.53
8.1.10.0060.00317.58
8.1.00.0040.00417.41
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0070.00018.44
8.0.270.0040.00416.86
8.0.260.0040.00417.30
8.0.250.0030.00316.93
8.0.240.0040.00416.96
8.0.230.0040.00416.86
8.0.220.0070.00016.89
8.0.210.0030.00316.85
8.0.200.0000.00917.03
8.0.190.0070.00016.92
8.0.180.0050.00216.98
8.0.170.0050.00216.93
8.0.160.0040.00416.77
8.0.150.0000.00816.82
8.0.140.0000.00716.77
8.0.130.0030.00313.31
8.0.120.0050.00316.84
8.0.110.0040.00416.90
8.0.100.0000.00716.84
8.0.90.0040.00416.88
8.0.80.0150.00716.95
8.0.70.0030.00516.82
8.0.60.0000.00716.71
8.0.50.0040.00416.71
8.0.30.0080.00917.14
8.0.20.0120.00917.40
8.0.10.0050.00216.89
8.0.00.0120.00816.91
7.4.330.0050.00016.81
7.4.320.0060.00016.63
7.4.300.0000.00716.66
7.4.290.0000.00716.61
7.4.280.0040.00416.65
7.4.270.0000.00816.43
7.4.260.0040.00416.52
7.4.250.0000.00716.52
7.4.240.0090.00016.49
7.4.230.0070.00016.49
7.4.220.0070.01116.57
7.4.210.0100.00716.60
7.4.200.0080.00016.71
7.4.160.0090.00616.43
7.4.150.0060.01217.40
7.4.140.0050.01417.86
7.4.130.0120.00916.66
7.4.120.0060.01216.56
7.4.110.0030.02216.51
7.4.100.0190.00316.60
7.4.90.0140.00316.59
7.4.80.0110.00619.39
7.4.70.0120.00316.55
7.4.60.0100.00716.62
7.4.50.0090.00616.56
7.4.40.0070.01016.29
7.4.30.0100.00816.62
7.4.00.0030.01214.81
7.3.330.0000.00513.32
7.3.320.0000.00513.18
7.3.310.0040.00316.36
7.3.300.0030.00316.22
7.3.290.0060.01016.43
7.3.280.0080.01116.40
7.3.270.0130.00317.40
7.3.260.0080.01216.31
7.3.240.0170.00616.63
7.3.230.0000.01816.49
7.3.210.0120.00316.62
7.3.200.0000.01616.50
7.3.190.0060.00916.68
7.3.180.0040.01216.40
7.3.170.0070.01016.45
7.3.160.0120.00916.55
7.3.120.0120.00315.11
7.3.110.0080.00814.67
7.3.100.0030.01314.83
7.3.90.0070.01014.81
7.3.80.0040.01114.69
7.3.70.0060.00615.02
7.3.60.0040.01114.96
7.3.50.0050.00314.83
7.3.40.0090.00314.87
7.3.30.0030.01014.57
7.3.20.0080.00016.61
7.3.10.0100.00016.74
7.3.00.0060.00616.76
7.2.330.0140.00316.48
7.2.320.0090.01616.50
7.2.310.0080.00816.50
7.2.300.0070.01016.68
7.2.290.0100.01416.77
7.2.250.0060.01215.05
7.2.240.0040.01515.04
7.2.230.0030.01015.12
7.2.220.0070.01115.19
7.2.210.0000.00915.00
7.2.200.0030.01615.25
7.2.190.0000.01414.80
7.2.180.0000.00814.89
7.2.170.0030.01215.05
7.2.60.4400.00615.19
7.2.50.5170.00915.27
7.2.40.5510.00715.44
7.2.30.2150.00915.66
7.2.20.1330.00615.50
7.2.10.0650.01015.49
7.2.00.0480.00815.59
7.1.330.0150.00015.92
7.1.320.0000.01215.84
7.1.310.0040.01215.59
7.1.300.0000.01315.89
7.1.290.0030.01015.81
7.1.280.0040.00416.03
7.1.270.0030.00615.82
7.1.260.0060.00615.66
7.1.200.0100.00315.58
7.1.170.0220.00813.84
7.1.160.5300.00917.02
7.1.150.4040.01016.93
7.1.140.0880.01117.06
7.1.130.0450.01316.77
7.1.120.5130.01216.68
7.1.110.4400.00916.27
7.1.100.1120.01216.17
7.1.90.3360.01216.25
7.1.80.0140.00816.06
7.1.70.2520.01216.22
7.1.60.0480.01326.45
7.1.50.2250.01224.90
7.1.40.0470.01632.63
7.1.30.2660.01432.89
7.1.20.2750.01132.65
7.1.10.1690.00614.98
7.1.00.0930.04418.71
7.0.300.1310.00613.53
7.0.290.0450.01116.43
7.0.270.0650.01016.40
7.0.260.3040.01016.64
7.0.250.0210.01116.18
7.0.240.3140.01216.07
7.0.230.0160.00815.61
7.0.220.0240.00815.77
7.0.210.2520.00914.94
7.0.200.1600.01015.04
7.0.190.4200.01114.78
7.0.180.0360.01014.25
7.0.170.2390.00914.49
7.0.160.2160.01214.42
7.0.150.1690.00814.45
7.0.140.1420.01214.56
7.0.130.1730.01014.82
7.0.120.1760.01114.69
7.0.110.1760.01514.46
7.0.100.1630.01114.55
7.0.90.1990.00814.79
7.0.80.1640.00714.57
7.0.70.1580.01014.48
7.0.60.0850.04618.01
7.0.50.0800.04516.17
7.0.40.0920.02417.32
7.0.30.1930.03917.39
7.0.20.0900.04717.49
7.0.10.0960.05417.36
7.0.00.0610.03617.41
5.6.300.0190.05420.84
5.6.290.0230.06820.58
5.6.280.0120.07520.95
5.6.270.0160.06320.82
5.6.260.0250.06420.84
5.6.250.0200.06820.80
5.6.240.0190.06020.79
5.6.230.0180.06121.00
5.6.220.0170.06420.80
5.6.210.0130.07220.82
5.6.200.0150.08019.57
5.6.190.0150.05720.76
5.6.180.0270.05420.61
5.6.170.0290.07420.83
5.6.160.0080.07420.66
5.6.150.0140.06819.52
5.6.140.0140.06319.48
5.6.130.0180.04319.46
5.6.120.0180.07121.01
5.6.110.0130.06621.00
5.6.100.0220.06620.93
5.6.90.0150.05720.85
5.6.80.0150.07620.37
5.6.70.0170.05820.32
5.6.60.0170.06520.08
5.6.50.0190.05320.20
5.6.40.0140.05920.14
5.6.30.0160.05820.40
5.6.20.0200.07420.32
5.6.10.0140.05420.16
5.6.00.0090.06420.11
5.5.380.0200.07617.64
5.5.370.0180.06717.47
5.5.360.0220.07317.48
5.5.350.0220.05118.90
5.5.340.0080.06417.93
5.5.330.0110.06119.14
5.5.320.0280.05719.03
5.5.310.0190.05319.18
5.5.300.0180.04817.88
5.5.290.0140.05718.01
5.5.280.0180.06919.46
5.5.270.0130.07719.32
5.5.260.0130.07719.33
5.5.250.0170.06419.15
5.5.240.0180.05918.77
5.5.230.0200.07217.08
5.5.220.0220.06317.41
5.5.210.0110.05817.13
5.5.200.0180.05117.39
5.5.190.0170.05417.39
5.5.180.0180.07617.10
5.5.160.0130.05417.37
5.5.150.0190.07317.09
5.5.140.0130.05417.46
5.5.130.0140.05617.46
5.5.120.0210.06617.37
5.5.110.0190.05017.36
5.5.100.0170.07817.30
5.5.90.0180.05417.31
5.5.80.0160.05317.05
5.5.70.0150.06017.02
5.5.60.0200.07117.04
5.5.50.0180.05416.98
5.5.40.0130.05516.98
5.5.30.0120.05817.18
5.5.20.0140.07617.27
5.5.10.0190.07217.04
5.5.00.0140.07717.36

preferences:
55.04 ms | 401 KiB | 5 Q