- print_r: documentation ( source)
<?php
class ArrayExtended implements ArrayAccess{
protected $ary = array();
public function __construct(array $a = null) {
if($a) $this->ary = $a;
}
public function offsetExists($off){}
public function offsetGet($off){}
public function offsetSet($off,$val){}
public function offsetUnset($off){}
}
$o = new ArrayExtended(['a','b']);
print_r($o);