<?php class Dictionary implements ArrayAccess { function offsetExists($offset) { var_dump($offset); return true; } function offsetGet($offset) { var_dump($offset); } function offsetUnset($offset) {} function offsetSet($offset, $value) { //var_dump($offset); } } $Dictionary = new Dictionary(); $Dictionary["12"] = 0xDEADBEEF; // int(12) $bar = $Dictionary["12"]; $str = "12"; $bar = $Dictionary[$str];
You have javascript disabled. You will not be able to edit any code.