<?php
class Test implements ArrayAccess
{
public function offsetSet($offset, $value) {
}
public function offsetExists($var) {
return true;
}
public function offsetUnset($var) {
}
public function offsetGet($var) {
return "value";
}
}
$test = new Test;
PD9waHAKCmNsYXNzIFRlc3QgaW1wbGVtZW50cyBBcnJheUFjY2VzcyAKewogICAgcHVibGljIGZ1bmN0aW9uIG9mZnNldFNldCgkb2Zmc2V0LCAkdmFsdWUpIHsKICAgICAgICB2YXJfZHVtcChfX01FVEhPRF9fLCAkdmFsdWUpOwogICAgfQogICAgcHVibGljIGZ1bmN0aW9uIG9mZnNldEV4aXN0cygkdmFyKSB7CiAgICAgICAgdmFyX2R1bXAoX19NRVRIT0RfXywgJHZhcik7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CiAgICBwdWJsaWMgZnVuY3Rpb24gb2Zmc2V0VW5zZXQoJHZhcikgewogICAgICAgIHZhcl9kdW1wKF9fTUVUSE9EX18pOwogICAgfQogICAgcHVibGljIGZ1bmN0aW9uIG9mZnNldEdldCgkdmFyKSB7CiAgICAgICAgdmFyX2R1bXAoX19NRVRIT0RfXywgJHZhcik7CiAgICAgICAgcmV0dXJuICJ2YWx1ZSI7CiAgICB9Cn0KCiR0ZXN0ID0gbmV3IFRlc3Q7CnZhcl9kdW1wKGlzc2V0KCR0ZXN0Wydhc2FzYXMnXSkpOwoKCg==