- var_dump: documentation ( source)
<?php
class ArrayObject implements ArrayAccess
{
private $data;
public function offsetSet($key, $value)
{
var_dump($key, $value);
$this->data[$key] = $value;
}
public function offsetGet($key)
{
return $this->data[$key];
}
public function offsetUnset($key)
{
unset($this->data[$key]);
}
public function offsetExists($key)
{
return isset($this->data[$key]);
}
}
$arr = new ArrayObject;
$arr[0] = 1;
$arr[] = 2;