fork(2) download
  1. <?php
  2.  
  3. class Test implements ArrayAccess
  4. {
  5. public function offsetSet($offset, $value) {
  6. var_dump(__METHOD__, $value);
  7. }
  8. public function offsetExists($var) {
  9. var_dump(__METHOD__, $var);
  10. }
  11. public function offsetUnset($var) {
  12. var_dump(__METHOD__);
  13. }
  14. public function offsetGet($var) {
  15. var_dump(__METHOD__, $var);
  16. return "value";
  17. }
  18. }
  19.  
  20. $test = new Test;
  21. var_dump(isset($test['asasas']));
  22.  
  23.  
  24.  
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
string(18) "Test::offsetExists"
string(6) "asasas"
bool(false)