3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Peoples implements ArrayAccess { function offsetExists($index) { return 1; } function offsetSet($index, $value) { } function offsetUnset($index) { } function offsetGet($index) { echo "GETARRAYPROXY\n"; $a = array() return $a; } } $people = new Peoples; $people[0][0] = 'FooBaz';
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected 'return' (T_RETURN) in /in/WDJHD on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_RETURN in /in/WDJHD on line 12
Process exited with code 255.