3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class MyFixedArray extends ArrayObject { public function offsetGet($offset) {} } $array = new MyFixedArray(10); $array[][1] = 10;
based on rFQ6d
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught InvalidArgumentException: Passed variable is not an array or object, using empty array instead in /in/u0QIi:7 Stack trace: #0 /in/u0QIi(7): ArrayObject->__construct(10) #1 {main} thrown in /in/u0QIi on line 7
Process exited with code 255.
Output for hhvm-3.12.0
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Passed variable is not an array or object, using empty array instead' in /in/u0QIi:7 Stack trace: #0 /in/u0QIi(7): ArrayObject->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Passed variable is not an array or object, using empty array instead' in /in/u0QIi:8 Stack trace: #0 /in/u0QIi(8): ArrayObject->__construct() #1 {main}
Process exited with code 255.
Output for 5.1.0 - 5.6.21
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Passed variable is not an array or object, using empty array instead' in /in/u0QIi:7 Stack trace: #0 /in/u0QIi(7): ArrayObject->__construct(10) #1 {main} thrown in /in/u0QIi on line 7
Process exited with code 255.
Output for 5.0.5
Fatal error: Uncaught exception 'Exception' with message 'Passed variable is not an array or object, using empty array instead' in /in/u0QIi:7 Stack trace: #0 /in/u0QIi(7): ArrayObject->__construct(10) #1 {main} thrown in /in/u0QIi on line 7
Process exited with code 255.
Output for 5.0.4
Fatal error: Uncaught exception 'Exception' with message 'Passed variable is not an array or object, using empty array instead' in /in/u0QIi:7 Stack trace: #0 /in/u0QIi(7): MyFixedArray->__construct(10) #1 {main} thrown in /in/u0QIi on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Warning: ArrayObject::__construct(): Passed variable is not an array or object, using empty array instead in /in/u0QIi on line 7
Process exited with code 139.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/u0QIi on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/u0QIi on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/u0QIi on line 4
Process exited with code 255.