3v4l.org

run code in 300+ PHP versions simultaneously
<?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.

preferences:
178.29 ms | 1398 KiB | 66 Q