3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = new ArrayObject(ArrayObject::ARRAY_AS_PROPS); $a->a = 1; $a->b = 2; var_dump($a);
Output for 7.0.20, 7.1.5 - 7.2.0
Fatal error: Uncaught InvalidArgumentException: Passed variable is not an array or object in /in/JqLhQ:3 Stack trace: #0 /in/JqLhQ(3): ArrayObject->__construct(2) #1 {main} thrown in /in/JqLhQ on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.6, 7.1.0
Fatal error: Uncaught InvalidArgumentException: Passed variable is not an array or object, using empty array instead in /in/JqLhQ:3 Stack trace: #0 /in/JqLhQ(3): ArrayObject->__construct(2) #1 {main} thrown in /in/JqLhQ on line 3
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Passed variable is not an array or object, using empty array instead' in /in/JqLhQ:3 Stack trace: #0 /in/JqLhQ(3): ArrayObject->__construct(2) #1 {main} thrown in /in/JqLhQ on line 3
Process exited with code 255.