3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [0,1,2,null,3]; foreach($a as $k => $v){ echo $v; } echo "\n"; class Test implements Iterator { private $p = 0; private $a = [0,1,2,null,3]; public function __construct() { array_unshift( $this->a, 8 ); } function rewind() { $this->p = 0; } function current() { return $this->a[$this->p]; } function key() { return $this->p; } function next() { ++$this->p; } function valid() { return isset( $this->a[$this->p] ); } } $it = new Test; foreach($it as $k => $v) { echo $v; } ?>

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.0140.00716.63
8.3.50.0100.00822.03
8.3.40.0070.00718.96
8.3.30.0070.00718.76
8.3.20.0040.00420.15
8.3.10.0040.00421.90
8.3.00.0080.00022.12
8.2.180.0110.00416.75
8.2.170.0100.01022.96
8.2.160.0100.00320.35
8.2.150.0080.00024.18
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0040.00420.08
8.2.110.0030.00620.97
8.2.100.0040.00817.91
8.2.90.0050.00318.16
8.2.80.0000.00920.55
8.2.70.0030.00617.75
8.2.60.0080.00017.63
8.2.50.0000.00917.93
8.2.40.0030.00619.89
8.2.30.0080.00019.20
8.2.20.0070.00017.80
8.2.10.0000.00818.13
8.2.00.0040.00417.81
8.1.280.0070.01125.92
8.1.270.0060.00323.76
8.1.260.0060.00326.35
8.1.250.0050.00328.09
8.1.240.0000.00822.08
8.1.230.0040.00820.59
8.1.220.0050.00317.88
8.1.210.0040.00418.84
8.1.200.0050.00317.64
8.1.190.0040.00417.35
8.1.180.0060.00318.10
8.1.170.0040.00417.62
8.1.160.0000.00722.02
8.1.150.0050.00218.82
8.1.140.0040.00419.63
8.1.130.0000.00917.66
8.1.120.0030.00617.46
8.1.110.0030.00617.37
8.1.100.0070.00017.44
8.1.90.0040.00417.44
8.1.80.0000.00717.44
8.1.70.0030.00517.43
8.1.60.0040.00417.62
8.1.50.0000.00817.48
8.1.40.0030.00617.54
8.1.30.0000.00817.54
8.1.20.0000.00817.63
8.1.10.0040.00417.54
8.1.00.0080.00017.48
8.0.300.0000.00720.09
8.0.290.0000.00816.75
8.0.280.0030.00318.42
8.0.270.0030.00317.21
8.0.260.0030.00316.75
8.0.250.0050.00216.84
8.0.240.0030.00316.94
8.0.230.0000.00817.00
8.0.220.0030.00316.92
8.0.210.0060.00016.79
8.0.200.0030.00316.91
8.0.190.0000.00816.98
8.0.180.0000.00716.82
8.0.170.0000.00716.97
8.0.160.0050.00216.95
8.0.150.0070.00016.89
8.0.140.0050.00316.93
8.0.130.0000.00513.29
8.0.120.0030.00516.86
8.0.110.0000.00716.89
8.0.100.0040.00416.79
8.0.90.0070.00016.73
8.0.80.0150.00616.93
8.0.70.0070.00016.85
8.0.60.0040.00416.84
8.0.50.0000.00816.77
8.0.30.0130.00717.06
8.0.20.0090.01017.40
8.0.10.0040.00417.01
8.0.00.0090.00916.83
7.4.330.0020.00215.08
7.4.320.0000.00616.47
7.4.300.0030.00316.62
7.4.290.0000.00816.53
7.4.280.0000.00816.52
7.4.270.0060.00016.62
7.4.260.0070.00016.51
7.4.250.0030.00516.60
7.4.240.0000.00716.66
7.4.230.0070.00016.59
7.4.220.0060.00916.46
7.4.210.0170.00316.62
7.4.200.0030.00316.62
7.4.160.0070.01116.61
7.4.150.0060.01117.40
7.4.140.0110.00717.86
7.4.130.0150.00516.58
7.4.120.0150.00616.49
7.4.110.0110.00716.40
7.4.100.0100.00716.46
7.4.90.0170.00216.43
7.4.80.0030.01419.39
7.4.70.0070.01416.48
7.4.60.0170.00016.62
7.4.50.0170.00016.48
7.4.40.0030.01316.54
7.4.30.0060.01016.64
7.4.10.0110.00715.10
7.4.00.0070.01014.69
7.3.330.0060.00013.37
7.3.320.0030.00313.19
7.3.310.0000.00816.39
7.3.300.0000.00616.38
7.3.290.0080.00916.36
7.3.280.0120.00516.34
7.3.270.0060.01217.40
7.3.260.0080.01116.47
7.3.250.0100.00716.42
7.3.240.0120.00516.52
7.3.230.0030.01316.39
7.3.210.0130.00416.54
7.3.200.0090.00616.36
7.3.190.0030.01216.52
7.3.180.0130.00316.34
7.3.170.0100.00616.38
7.3.160.0000.02316.62
7.3.130.0070.01114.91
7.3.120.0070.01014.90
7.3.110.0060.01315.04
7.3.100.0030.00715.08
7.3.90.0070.01115.06
7.3.80.0070.00714.99
7.3.70.0060.01014.65
7.3.60.0090.00314.88
7.3.50.0030.00914.86
7.3.40.0060.00614.87
7.3.30.0070.00714.91
7.3.20.0000.01116.67
7.3.10.0030.00916.91
7.3.00.0000.01316.69
7.2.330.0070.01116.48
7.2.320.0170.00816.54
7.2.310.0130.00316.71
7.2.300.0110.00716.81
7.2.290.0000.01916.59
7.2.260.0030.01414.95
7.2.250.0100.00715.27
7.2.240.0070.01015.24
7.2.230.0120.00415.23
7.2.220.0140.00415.28
7.2.210.0120.00414.98
7.2.200.0100.00315.29
7.2.190.0030.00614.98
7.2.180.0060.00615.28
7.2.170.0060.00915.18
7.2.160.0030.00915.19
7.2.150.0070.00417.04
7.2.140.0040.00816.88
7.2.130.0070.00716.88
7.2.120.0040.00816.88
7.2.110.0040.00816.60
7.2.100.0060.00616.77
7.2.90.0070.00417.00
7.2.80.0060.00816.79
7.2.70.0030.00617.04
7.2.60.0080.00816.82
7.2.50.0040.00817.11
7.2.40.0120.00616.82
7.2.30.0080.00816.86
7.2.20.0060.00916.62
7.2.10.0030.01317.01
7.2.00.0060.00717.98
7.1.330.0000.01215.83
7.1.320.0070.01115.71
7.1.310.0070.00715.53
7.1.300.0040.00815.81
7.1.290.0030.00715.60
7.1.280.0080.00615.84
7.1.270.0000.01115.85
7.1.260.0060.01015.84
7.1.250.0090.00615.89
7.1.240.0060.00615.55
7.1.230.0090.00915.97
7.1.220.0030.00615.95
7.1.210.0000.01216.00
7.1.200.0020.00915.65
7.1.190.0080.00415.62
7.1.180.0060.00615.55
7.1.170.0000.01115.65
7.1.160.0030.00615.72
7.1.150.0070.00715.50
7.1.140.0060.00915.71
7.1.130.0040.01115.78
7.1.120.0030.01015.86
7.1.110.0030.01215.50
7.1.100.0110.00317.17
7.1.90.0030.00815.70
7.1.80.0080.00415.86
7.1.70.0000.01116.43
7.1.60.0030.01016.47
7.1.50.0070.01216.45
7.1.40.0070.00315.94
7.1.30.0030.01016.01
7.1.20.0030.00615.75
7.1.10.0040.01115.77
7.1.00.0050.04118.96
7.0.330.0030.00715.41
7.0.320.0060.01015.48
7.0.310.0030.01015.59
7.0.300.0050.00515.35
7.0.290.0060.00315.44
7.0.280.0060.00915.35
7.0.270.0070.00415.23
7.0.260.0030.01015.45
7.0.250.0090.00915.39
7.0.240.0030.01015.39
7.0.230.0060.00615.34
7.0.220.0000.00815.52
7.0.210.0100.00015.36
7.0.200.0090.00915.04
7.0.190.0030.01015.64
7.0.180.0030.01015.47
7.0.170.0060.00315.46
7.0.160.0080.00615.51
7.0.150.0060.00615.41
7.0.140.0000.00915.64
7.0.130.0070.00415.47
7.0.120.0070.00715.54
7.0.110.0070.00315.50
7.0.100.0050.03317.77
7.0.90.0060.03117.82
7.0.80.0070.03217.64
7.0.70.0080.03017.73
7.0.60.0070.03217.79
7.0.50.0140.02417.93
7.0.40.0080.03816.90
7.0.30.0070.03416.78
7.0.20.0090.03216.90
7.0.10.0090.03916.84
7.0.00.0070.03316.91
5.6.400.0060.00614.77
5.6.390.0070.00414.48
5.6.380.0030.00914.09
5.6.370.0030.01014.53
5.6.360.0060.00314.59
5.6.350.0100.00314.43
5.6.340.0030.00914.66
5.6.330.0030.01014.51
5.6.320.0030.00914.55
5.6.310.0040.00814.50
5.6.300.0070.00714.31
5.6.290.0120.00314.29
5.6.280.0060.00614.38
5.6.270.0080.00614.80
5.6.260.0040.00414.59
5.6.250.0050.03217.69
5.6.240.0090.03117.51
5.6.230.0100.03517.48
5.6.220.0060.03317.43
5.6.210.0060.02917.40
5.6.200.0100.03017.71
5.6.190.0070.03017.78
5.6.180.0020.03517.82
5.6.170.0080.03217.69
5.6.160.0030.03517.72
5.6.150.0030.03517.68
5.6.140.0080.03317.81
5.6.130.0090.03017.72
5.6.120.0010.03417.67
5.6.110.0060.03117.74
5.6.100.0050.03117.83
5.6.90.0090.02917.72
5.6.80.0070.03017.50
5.6.70.0060.03117.25
5.6.60.0040.03417.38
5.6.50.0080.02817.31
5.6.40.0100.02817.36
5.6.30.0080.02817.36
5.6.20.0110.02817.24
5.6.10.0070.03117.48
5.6.00.0050.03217.36

preferences:
63.25 ms | 401 KiB | 5 Q