3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new ArrayObject(1,2,3,4,5); var_dump($a); echo $a->getIterator()->current(); $a->getIterator()->next(); $a->getIterator()->next(); echo $a->getIterator()->current();
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught ArgumentCountError: ArrayObject::__construct() expects at most 3 arguments, 5 given in /in/bMmjd:4 Stack trace: #0 /in/bMmjd(4): ArrayObject->__construct(1, 2, 3, 4, 5) #1 {main} thrown in /in/bMmjd on line 4
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught ArgumentCountError: ArrayObject::__construct() expects at most 3 parameters, 5 given in /in/bMmjd:4 Stack trace: #0 /in/bMmjd(4): ArrayObject->__construct(1, 2, 3, 4, 5) #1 {main} thrown in /in/bMmjd on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Fatal error: Uncaught TypeError: ArrayObject::__construct() expects at most 3 parameters, 5 given in /in/bMmjd:4 Stack trace: #0 /in/bMmjd(4): ArrayObject->__construct(1, 2, 3, 4, 5) #1 {main} thrown in /in/bMmjd on line 4
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'ArrayObject::__construct() expects at most 3 parameters, 5 given' in /in/bMmjd:4 Stack trace: #0 /in/bMmjd(4): ArrayObject->__construct(1, 2, 3, 4, 5) #1 {main} thrown in /in/bMmjd on line 4
Process exited with code 255.

preferences:
179.51 ms | 402 KiB | 209 Q