3v4l.org

run code in 300+ PHP versions simultaneously
<?php $map = new Map(["a" => 1, "b" => 2]); $b = new ArrayIterator($dict); print var_dump($b); class A { public $x; public $y; public function __construct($x, $y) { $this->x = $x; $this->y = $y; } } $a = new A(1, "42"); print var_dump((new ArrayObject($a))->getIterator()); print "obj\n"; foreach ($a as $v) { $a->y = "500"; print $v . "\n"; } print "arr\n"; $b = array(1, 2, 3); foreach($b as $v) { $b[1] = 500; print $v . "\n"; } print "arr_iter\n"; $c = array(1, 2, 3); $i = new ArrayIterator($c); $i->rewind(); while ($i->valid()) { $c[1] = 500; print $i->current() . "\n"; $i->next(); }

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.0070.00718.56
8.3.50.0140.00316.56
8.3.40.0070.00718.98
8.3.30.0110.00318.80
8.3.20.0040.00420.18
8.3.10.0050.00321.93
8.3.00.0040.00419.26
8.2.180.0120.00318.54
8.2.170.0060.00922.96
8.2.160.0100.00320.39
8.2.150.0030.00624.18
8.2.140.0090.00024.66
8.2.130.0080.00021.04
8.2.120.0040.00426.35
8.2.110.0090.00022.27
8.2.100.0090.00318.03
8.2.90.0050.00317.84
8.2.80.0000.00819.11
8.2.70.0040.00418.04
8.2.60.0060.00317.80
8.2.50.0030.00518.10
8.2.40.0060.00320.55
8.2.30.0000.00719.27
8.2.20.0070.00017.93
8.2.10.0070.00018.01
8.2.00.0050.00318.08
8.1.280.0030.01325.92
8.1.270.0040.00419.95
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0040.00422.15
8.1.230.0060.00620.95
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0060.00317.10
8.1.190.0060.00317.23
8.1.180.0050.00318.10
8.1.170.0080.00018.39
8.1.160.0000.00818.72
8.1.150.0050.00320.23
8.1.140.0030.00719.02
8.1.130.0030.00318.89
8.1.120.0030.00317.27
8.1.110.0070.00317.32
8.1.100.0050.00317.37
8.1.90.0040.00417.25
8.1.80.0000.00817.38
8.1.70.0030.00717.20
8.1.60.0040.00417.50
8.1.50.0000.00717.38
8.1.40.0030.00617.52
8.1.30.0040.00417.56
8.1.20.0000.00817.59
8.1.10.0030.00617.55
8.1.00.0040.00417.36
8.0.300.0000.00820.04
8.0.290.0020.00516.75
8.0.280.0030.00318.40
8.0.270.0000.00717.23
8.0.260.0060.00017.24
8.0.250.0000.00716.96
8.0.240.0040.00417.00
8.0.230.0100.00017.01
8.0.220.0000.00816.91
8.0.210.0070.00016.94
8.0.200.0060.00017.00
8.0.190.0000.00816.89
8.0.180.0070.00016.91
8.0.170.0080.00416.82
8.0.160.0080.00017.00
8.0.150.0040.00416.82
8.0.140.0030.00516.93
8.0.130.0000.00513.37
8.0.120.0040.00416.92
8.0.110.0020.00516.74
8.0.100.0030.00516.73
8.0.90.0060.00316.94
8.0.80.0040.01116.88
8.0.70.0070.00016.83
8.0.60.0050.00316.77
8.0.50.0040.00416.93
8.0.30.0110.01017.08
8.0.20.0090.01117.40
8.0.10.0000.00816.82
8.0.00.0070.01216.70
7.4.330.0020.00215.55
7.4.320.0000.00616.51
7.4.300.0000.00616.41
7.4.290.0070.00016.55
7.4.280.0090.00016.47
7.4.270.0000.00716.47
7.4.260.0000.00816.55
7.4.250.0000.00716.52
7.4.240.0070.00016.47
7.4.230.0040.00416.46
7.4.220.0040.00416.59
7.4.210.0110.00416.58
7.4.200.0050.00216.57
7.4.160.0110.00816.51
7.4.150.0090.00917.40
7.4.140.0130.00617.86
7.4.130.0150.00416.52
7.4.120.0110.01116.56
7.4.110.0100.00716.50
7.4.100.0070.01016.54
7.4.90.0030.01316.51
7.4.80.0150.00619.39
7.4.70.0070.01016.45
7.4.60.0130.00316.32
7.4.50.0060.00616.60
7.4.40.0070.01016.19
7.4.00.0080.00414.82
7.3.330.0000.00513.35
7.3.320.0020.00213.30
7.3.310.0070.00016.28
7.3.300.0070.00016.33
7.3.290.0090.00816.33
7.3.280.0090.00916.31
7.3.270.0090.00917.40
7.3.260.0120.00716.36
7.3.250.0130.00416.44
7.3.240.0120.00816.43
7.3.230.0060.01616.32
7.3.210.0170.00016.37
7.3.200.0100.01316.62
7.3.190.0050.01116.52
7.3.180.0100.00716.43
7.3.170.0090.00816.48
7.3.160.0120.00616.26
7.2.330.0090.00916.57
7.2.320.0060.01116.38
7.2.310.0110.00616.63
7.2.300.0050.01816.31
7.2.290.0110.00516.32
7.2.60.0060.00316.88
7.2.10.0340.01017.38
7.2.00.0260.01417.54
7.1.200.0100.00315.64
7.1.130.0360.00616.41
7.1.120.0300.00316.08
7.1.110.0280.01215.95
7.1.100.0370.01016.13
7.1.90.0300.01215.82
7.1.80.0420.00715.95
7.1.70.0360.00414.93
7.1.60.0400.01733.16
7.1.50.0410.01132.87
7.1.40.0420.01132.39
7.1.30.0520.01432.41
7.1.20.0360.01632.69
7.1.10.0310.01314.74
7.1.00.0240.01014.90

preferences:
54.8 ms | 401 KiB | 5 Q