3v4l.org

run code in 300+ PHP versions simultaneously
<?php readonly class A implements IteratorAggregate { function __construct(public string $foo = 'bar') {} function getIterator() : Traversable { return new ArrayIterator($this); } } $obj = new A; foreach ($obj as $k => &$v) { $v = 'baz'; } var_dump($obj); // changed a readonly property

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.2.90.0060.00718.80
8.2.80.0270.00017.38
8.2.70.0190.00717.38
8.2.60.0230.00317.25
8.2.50.0260.00017.38
8.2.40.0120.00517.59
8.2.30.0140.00317.59
8.2.20.0130.00517.57
8.2.10.0120.01017.62
8.2.00.0160.00417.49
8.1.220.0070.00718.89
8.1.210.0180.00916.80
8.1.200.0190.00817.00
8.1.190.0230.00416.88
8.1.180.0240.00316.80
8.1.170.0120.00317.79
8.1.160.0150.00517.43
8.1.150.0150.00517.38
8.1.140.0170.00417.48
8.1.130.0180.00417.48
8.1.120.0180.00517.40
8.1.110.0160.00417.40
8.1.100.0130.00717.45
8.1.90.0160.00417.45
8.1.80.0110.00817.53
8.1.70.0160.00417.44
8.1.60.0180.00417.52
8.1.50.0180.00517.40
8.1.40.0190.00317.45
8.1.30.0170.00517.44
8.1.20.0160.00717.52
8.1.10.0170.00517.40
8.1.00.0170.00417.49
8.0.300.0070.00718.17
8.0.290.0180.00716.80
8.0.280.0110.00317.47
8.0.270.0150.00617.38
8.0.260.0120.00617.38
8.0.250.0170.00217.38
8.0.240.0130.00717.38
8.0.230.0180.00217.38
8.0.220.0160.00417.38
8.0.210.0160.00317.38
8.0.200.0170.00217.38
8.0.190.0140.00617.38
8.0.180.0170.00217.38
8.0.170.0160.00517.38
8.0.160.0120.00817.38
8.0.150.0150.00517.38
8.0.140.0130.00617.38
8.0.130.0150.00517.38
8.0.120.0160.00417.38
8.0.110.0130.00517.38
8.0.100.0130.00617.38
8.0.90.0140.00517.38
8.0.80.0170.00317.38
8.0.70.0170.00217.38
8.0.60.0160.00317.38
8.0.50.0170.00217.38
8.0.30.0130.00617.38
8.0.20.0130.00617.38
8.0.10.0120.00717.38

preferences:
144.35 ms | 1394 KiB | 7 Q