3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Cars implements Iterator { private $pointer = 0; private $array = array(); public function __construct() { $this->pointer = 0; } public function addCar($car) { array_push($this->array, $car); } function rewind() { $this->pointer = 0; } function current() { return $this->array[$this->pointer]; } function key() { return $this->pointer; } function next() { ++$this->pointer; } public function valid() { return isset($this->array[$this->pointer]); } } $car = new Cars; $car->addCar("Volvo"); $car->addCar("BMW"); $car->addCar("Mercedes"); foreach ($car as $key => $value) { echo $key . ": " . $value . "<br />"; }

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.0060.01118.50
8.3.50.0070.00718.44
8.3.40.0080.00618.83
8.3.30.0070.00718.75
8.3.20.0050.00321.91
8.3.10.0050.00321.73
8.3.00.0090.00019.85
8.2.180.0110.00418.29
8.2.170.0140.00022.96
8.2.160.0070.01119.21
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00722.25
8.2.120.0070.00026.35
8.2.110.0050.00522.15
8.2.100.0060.00618.21
8.2.90.0040.00419.22
8.2.80.0030.00517.97
8.2.70.0040.00417.63
8.2.60.0090.00018.03
8.2.50.0040.00418.10
8.2.40.0040.00422.18
8.2.30.0000.00721.15
8.2.20.0040.00417.76
8.2.10.0040.00418.06
8.2.00.0040.00418.01
8.1.280.0040.01125.92
8.1.270.0080.00023.87
8.1.260.0080.00028.09
8.1.250.0070.00028.09
8.1.240.0060.00319.01
8.1.230.0100.00017.95
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0000.00917.35
8.1.190.0000.00817.35
8.1.180.0030.00518.10
8.1.170.0090.00018.48
8.1.160.0000.00722.02
8.1.150.0080.00018.91
8.1.140.0000.00719.61
8.1.130.0060.00317.71
8.1.120.0070.00017.49
8.1.110.0050.00217.50
8.1.100.0000.00717.46
8.1.90.0050.00217.44
8.1.80.0040.00417.47
8.1.70.0030.00317.44
8.1.60.0000.00817.59
8.1.50.0030.00617.45
8.1.40.0040.00417.52
8.1.30.0000.00817.58
8.1.20.0030.00617.64
8.1.10.0040.00417.54
8.1.00.0080.00017.55
8.0.300.0040.00418.77
8.0.290.0090.00016.75
8.0.280.0070.00018.45
8.0.270.0030.00317.28
8.0.260.0000.00617.18
8.0.250.0040.00416.97
8.0.240.0000.00617.00
8.0.230.0030.00316.98
8.0.220.0030.00316.84
8.0.210.0030.00316.77
8.0.200.0030.00316.92
8.0.190.0000.00816.91
8.0.180.0040.00416.83
8.0.170.0080.00016.77
8.0.160.0070.00016.92
8.0.150.0000.00716.78
8.0.140.0060.00616.87
8.0.130.0060.00013.37
8.0.120.0000.00716.86
8.0.110.0040.00416.78
8.0.100.0040.00416.77
8.0.90.0040.00416.83
8.0.80.0080.00616.94
8.0.70.0000.00816.73
8.0.60.0000.00716.81
8.0.50.0040.00416.91
8.0.30.0090.01117.19
8.0.20.0060.01217.40
8.0.10.0070.00016.99
8.0.00.0070.01016.82
7.4.330.0000.00515.08
7.4.320.0000.00616.63
7.4.300.0030.00516.43
7.4.290.0000.00716.62
7.4.280.0070.00416.47
7.4.270.0000.00716.42
7.4.260.0030.00316.48
7.4.250.0080.00016.48
7.4.240.0000.00916.43
7.4.230.0000.00616.39
7.4.220.0200.00316.62
7.4.210.0080.00816.71
7.4.200.0000.00716.42
7.4.160.0100.00716.51
7.4.150.0070.01117.40
7.4.140.0090.01217.86
7.4.130.0080.01116.61
7.4.120.0070.01116.55
7.4.110.0120.00616.51
7.4.100.0170.00616.65
7.4.90.0140.00516.68
7.4.80.0030.01419.39
7.4.70.0030.01316.46
7.4.60.0070.01016.65
7.4.50.0110.00416.45
7.4.40.0150.00816.40
7.4.30.0170.00016.50
7.4.00.0070.01015.05
7.3.330.0030.00313.35
7.3.320.0000.00613.18
7.3.310.0030.00316.18
7.3.300.0070.00016.25
7.3.290.0060.00716.32
7.3.280.0090.00916.35
7.3.270.0100.00717.40
7.3.260.0130.00616.42
7.3.250.0100.00916.51
7.3.240.0130.00716.58
7.3.230.0100.00716.55
7.3.210.0100.00716.47
7.3.200.0090.00616.41
7.3.190.0070.01416.42
7.3.180.0070.01016.41
7.3.170.0070.01016.42
7.3.160.0100.00716.58
7.2.330.0140.00716.91
7.2.320.0090.00616.85
7.2.310.0130.00316.44
7.2.300.0140.00916.80
7.2.290.0120.00616.74
7.2.60.0030.01316.78
7.2.50.0070.00717.02
7.1.200.0070.00715.69
7.1.70.0000.00817.01
7.1.60.0040.00719.75
7.1.00.0030.07322.42
7.0.200.0040.00814.96
7.0.90.0400.06320.04
7.0.80.0270.05019.84
7.0.70.0600.06720.03
7.0.60.0430.05319.98
7.0.50.0370.05320.34
7.0.40.0300.06020.31
7.0.30.0370.06320.38
7.0.20.0330.06720.37
7.0.10.0400.05320.32
7.0.00.0630.07020.41
5.6.240.0070.08020.71
5.6.230.0130.05720.76
5.6.220.0130.05720.77
5.6.210.0130.05720.83
5.6.200.0170.05721.03
5.6.190.0130.06021.07
5.6.180.0070.06321.18
5.6.170.0170.05321.10
5.6.160.0070.07021.02
5.6.150.0130.06021.19
5.6.140.0170.04721.07
5.6.130.0170.06721.02
5.6.120.0130.06021.20
5.6.110.0300.06021.08
5.6.100.0070.06721.01
5.6.90.0130.06321.08
5.6.80.0130.05320.46
5.6.70.0130.07320.56
5.6.60.0100.05320.46
5.6.50.0000.06720.49
5.6.40.0070.06020.46
5.6.30.0200.04720.45
5.6.20.0200.06320.54
5.6.10.0130.05020.56
5.6.00.0030.06020.43

preferences:
57.55 ms | 400 KiB | 5 Q