<?php class Foo implements ArrayAccess { public function offsetGet($x) { var_dump($x); } public function offsetExists($x) {} public function offsetSet($x, $y) {} public function offsetUnset($x) {} } $foo = new Foo(); echo $foo['0']; $a = '0'; echo $foo[$a];
You have javascript disabled. You will not be able to edit any code.