3v4l.org

run code in 300+ PHP versions simultaneously
<?php class InfiniteNumbers implements Iterator { public $start; public $current; public function __construct($start) { $this->start = $start; $this->current = $start; } public function next() { $this->current++; } public function current() { return $this->current; } public function key() { return $this->current; } public function rewind() { $this->current = $this->start; } public function valid() { return true; } } $infinite = new InfiniteNumbers(1); foreach($infinite as $number) { if($number > 1000) { break; } echo $number."\n"; }

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.0160.00316.63
8.3.50.0110.00716.23
8.3.40.0060.01018.98
8.3.30.0100.00718.89
8.3.20.0030.00620.33
8.3.10.0090.00021.80
8.3.00.0090.00018.05
8.2.180.0160.00716.50
8.2.170.0110.01118.89
8.2.160.0100.00722.96
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0040.00420.34
8.2.120.0040.00426.35
8.2.110.0110.00019.34
8.2.100.0070.00717.78
8.2.90.0030.00618.03
8.2.80.0110.00017.97
8.2.70.0000.01017.93
8.2.60.0040.00417.97
8.2.50.0040.00418.10
8.2.40.0040.00422.06
8.2.30.0040.00419.26
8.2.20.0000.00918.18
8.2.10.0040.00418.18
8.2.00.0050.00318.42
8.1.280.0070.01325.92
8.1.270.0040.00422.14
8.1.260.0060.00326.35
8.1.250.0000.01028.09
8.1.240.0070.00322.60
8.1.230.0100.00320.82
8.1.220.0060.00317.76
8.1.210.0000.00918.88
8.1.200.0090.00017.36
8.1.190.0060.00317.38
8.1.180.0060.00318.10
8.1.170.0040.00418.67
8.1.160.0030.00518.94
8.1.150.0050.00320.18
8.1.140.0000.00819.59
8.1.130.0040.00418.93
8.1.120.0040.00417.43
8.1.110.0060.00317.49
8.1.100.0000.00817.45
8.1.90.0090.00017.47
8.1.80.0000.00817.37
8.1.70.0040.00417.35
8.1.60.0050.00517.61
8.1.50.0000.00917.55
8.1.40.0060.00317.47
8.1.30.0050.00517.63
8.1.20.0030.00617.65
8.1.10.0000.00917.62
8.1.00.0060.00317.40
8.0.300.0030.00620.02
8.0.290.0060.00316.75
8.0.280.0040.00418.46
8.0.270.0050.00317.25
8.0.260.0030.00619.05
8.0.250.0040.00416.96
8.0.240.0040.00416.94
8.0.230.0000.00816.95
8.0.220.0030.00516.92
8.0.210.0030.00516.83
8.0.200.0090.00016.98
8.0.190.0040.00416.94
8.0.180.0040.00416.90
8.0.170.0000.00816.82
8.0.160.0000.00816.80
8.0.150.0060.00316.80
8.0.140.0080.00416.88
8.0.130.0000.00613.37
8.0.120.0030.00616.87
8.0.110.0040.00416.93
8.0.100.0030.00516.85
8.0.90.0080.00016.79
8.0.80.0090.01516.96
8.0.70.0090.00016.91
8.0.60.0030.00516.87
8.0.50.0030.00516.77
8.0.30.0150.00817.00
8.0.20.0110.01317.40
8.0.10.0060.00316.82
8.0.00.0220.01516.82
7.4.330.0060.00015.55
7.4.320.0070.00016.59
7.4.300.0030.00316.50
7.4.290.0060.00316.61
7.4.280.0040.00416.40
7.4.270.0000.00816.56
7.4.260.0040.00416.61
7.4.250.0030.00616.48
7.4.240.0060.00316.61
7.4.230.0030.00516.66
7.4.220.0080.02116.54
7.4.210.0140.00316.52
7.4.200.0040.00416.64
7.4.160.0210.00316.46
7.4.150.0250.00817.40
7.4.140.0120.01317.86
7.4.130.0110.01116.52
7.4.120.0130.01816.60
7.4.110.0150.00816.41
7.4.100.0070.01416.49
7.4.90.0110.01116.54
7.4.80.0100.01819.39
7.4.70.0080.01716.60
7.4.60.0060.01216.32
7.4.50.0100.00716.50
7.4.40.0140.00516.61
7.4.30.0100.01016.30
7.4.10.0070.01115.07
7.4.00.0050.01314.95
7.3.330.0000.00513.31
7.3.320.0070.00013.04
7.3.310.0040.00416.27
7.3.300.0050.00216.36
7.3.290.0100.01116.31
7.3.280.0110.01116.28
7.3.270.0200.01017.40
7.3.260.0120.01416.62
7.3.250.0110.01416.40
7.3.240.0140.01316.36
7.3.230.0120.01216.43
7.3.210.0160.00616.52
7.3.200.0210.00716.31
7.3.190.0060.01516.43
7.3.180.0150.01516.51
7.3.170.0150.01516.35
7.3.160.0070.01316.39
7.3.130.0120.00615.05
7.3.120.0110.01114.84
7.3.110.0070.01414.93
7.3.100.0060.00915.04
7.3.90.0100.00714.84
7.3.80.0040.00715.13
7.3.70.0090.00614.88
7.3.60.0130.00214.84
7.3.50.0030.01015.01
7.3.40.0030.01214.68
7.3.30.0060.00814.74
7.3.20.0000.01416.62
7.3.10.0080.00816.69
7.3.00.0040.00816.79
7.2.330.0070.01416.83
7.2.320.0090.02116.77
7.2.310.0100.01316.73
7.2.300.0080.01616.59
7.2.290.0090.01216.49
7.2.260.0000.01915.02
7.2.250.0070.01715.09
7.2.240.0180.00015.30
7.2.230.0030.01415.09
7.2.220.0060.01615.21
7.2.210.0030.01015.19
7.2.200.0110.00815.11
7.2.190.0030.01315.10
7.2.180.0070.01014.93
7.2.170.0090.00615.10
7.2.160.0060.00915.04
7.2.150.0130.00616.89
7.2.140.0090.00616.92
7.2.130.0060.00916.71
7.2.120.0040.01516.85
7.2.110.0070.00717.06
7.2.100.0060.01217.02
7.2.90.0080.00417.18
7.2.80.0030.00916.96
7.2.70.0160.00317.09
7.2.60.0080.00716.98
7.2.50.0110.00717.22
7.2.40.0190.00016.73
7.2.30.0060.00917.04
7.2.20.0100.01016.93
7.2.10.0040.01117.04
7.2.00.0030.01317.19
7.1.330.0040.01115.85
7.1.320.0070.01015.91
7.1.310.0000.01415.69
7.1.300.0080.00815.66
7.1.290.0070.00715.78
7.1.280.0000.01315.89
7.1.270.0070.01015.76
7.1.260.0100.00615.70
7.1.250.0030.01215.92
7.1.240.0100.00315.52
7.1.230.0090.00615.91
7.1.220.0080.00315.84
7.1.210.0030.00715.82
7.1.200.0000.01315.74
7.1.190.0040.00815.72
7.1.180.0140.00315.91
7.1.170.0030.01315.86
7.1.160.0030.00715.69
7.1.150.0130.00715.68
7.1.140.0090.00315.77
7.1.130.0000.01315.86
7.1.120.0060.00615.70
7.1.110.0000.01515.80
7.1.100.0030.01015.57
7.1.90.0040.01115.87
7.1.80.0090.00615.82
7.1.70.0110.00516.49
7.1.60.0020.01416.33
7.1.50.0000.01515.70
7.1.40.0130.00825.09
7.1.30.0110.01325.07
7.1.20.0110.01325.06
7.1.10.0080.01316.06
7.1.00.0040.01016.15
7.0.330.0040.01115.57
7.0.320.0070.01015.43
7.0.310.0030.01415.28
7.0.300.0110.00715.52
7.0.290.0030.01015.34
7.0.280.0130.00615.20
7.0.270.0110.00315.46
7.0.260.0070.01015.66
7.0.250.0160.00615.33
7.0.240.0030.01015.51
7.0.230.0080.00815.34
7.0.220.0080.00415.43
7.0.210.0000.01815.11
7.0.200.0030.00616.18
7.0.190.0090.00615.51
7.0.180.0030.01315.89
7.0.170.0080.00615.78
7.0.160.0080.01015.92
7.0.150.0070.01315.80
7.0.140.0070.01215.89
7.0.130.0050.00915.85
7.0.120.0060.00815.98
7.0.110.0070.00515.76
7.0.100.0050.01015.80
7.0.90.0140.00315.94
7.0.80.0030.01315.98
7.0.70.0050.01115.68
7.0.60.0080.00815.80
7.0.50.0050.00915.76
7.0.40.0100.00915.06
7.0.30.0070.00714.79
7.0.20.0110.00714.73
7.0.10.0060.01015.05
7.0.00.0030.01114.78
5.6.400.0000.01114.64
5.6.390.0070.00713.91
5.6.380.0040.01114.75
5.6.370.0060.00914.38
5.6.360.0070.00714.43
5.6.350.0070.01114.34
5.6.340.0060.01014.66
5.6.330.0040.01114.40
5.6.320.0140.00014.18
5.6.310.0060.01014.38
5.6.300.0100.01014.06
5.6.290.0140.00714.61
5.6.280.0080.00314.48
5.6.270.0100.01014.52
5.6.260.0100.00614.38
5.6.250.0000.01814.57
5.6.240.0040.00714.16
5.6.230.0060.01214.76
5.6.220.0130.00614.45
5.6.210.0070.00714.68
5.6.200.0030.01314.66
5.6.190.0000.01114.08
5.6.180.0000.01114.67
5.6.170.0120.00614.44
5.6.160.0000.01314.19
5.6.150.0030.01014.25
5.6.140.0040.01514.23
5.6.130.0070.01414.39
5.6.120.0110.00714.35
5.6.110.0030.00914.50
5.6.100.0030.00714.18
5.6.90.0090.00614.27
5.6.80.0090.00914.68
5.6.70.0090.00914.14
5.6.60.0130.00314.27
5.6.50.0060.01314.27
5.6.40.0000.01114.30
5.6.30.0000.01014.05
5.6.20.0040.01114.39
5.6.10.0060.01014.21
5.6.00.0030.01014.38

preferences:
54.83 ms | 401 KiB | 5 Q