3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DoctorFilter extends FilterIterator { public function accept(): bool { $obj = $this->getInnerIterator()->current(); return is_string($obj) && str_starts_with($obj, 'Dr.'); } } $people = [ 'Dr. Jekyll', 'Mr. Hyde', // This item will be removed 'Dr. Frankenstein', ]; foreach (new DoctorFilter(new ArrayIterator($people)) as $item) { echo $item.PHP_EOL; }

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.4.120.0120.00724.25
8.4.110.0090.01022.38
8.4.100.0130.00718.83
8.4.90.0090.00820.47
8.4.80.0090.01019.59
8.4.70.0050.00317.74
8.4.60.0120.00918.80
8.4.50.0080.01219.39
8.4.40.0040.00420.76
8.4.30.0130.00623.73
8.4.20.0100.01017.94
8.4.10.0090.00021.88
8.3.250.0120.00718.98
8.3.240.0150.00517.07
8.3.230.0090.01116.49
8.3.220.0120.00718.80
8.3.210.0070.01116.80
8.3.200.0030.00516.50
8.3.190.0060.00817.30
8.3.180.0070.00216.55
8.3.170.0090.00917.29
8.3.160.0090.00918.18
8.3.150.0110.01119.11
8.3.140.0120.00016.50
8.3.130.0060.00318.59
8.3.120.0080.00020.84
8.3.110.0130.00620.94
8.3.100.0000.00824.06
8.3.90.0000.00826.77
8.3.80.0030.00619.36
8.3.70.0120.00316.63
8.3.60.0090.01218.31
8.3.50.0110.01118.53
8.3.40.0070.00721.82
8.3.30.0090.00618.55
8.3.20.0000.00824.18
8.3.10.0040.00424.66
8.3.00.0070.00026.16
8.2.290.0070.01120.55
8.2.280.0050.00218.24
8.2.270.0070.01116.98
8.2.260.0030.00618.37
8.2.250.0080.00016.47
8.2.240.0080.00018.99
8.2.230.0050.00522.58
8.2.220.0040.00424.06
8.2.210.0040.00426.77
8.2.200.0060.00318.88
8.2.190.0100.01016.58
8.2.180.0100.01016.50
8.2.170.0100.00718.96
8.2.160.0030.01022.96
8.2.150.0030.00525.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00026.16
8.2.110.0090.00022.11
8.2.100.0100.00020.35
8.2.60.0040.00619.33
8.1.330.0120.00721.79
8.1.320.0160.00616.14
8.1.310.0120.00616.58
8.1.300.0110.00416.25
8.1.290.0000.00930.84
8.1.280.0100.00725.92
8.1.270.0030.00522.19
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0030.00619.01
8.1.230.0080.00318.37

preferences:
28.82 ms | 403 KiB | 5 Q