- var_dump: documentation ( source)
<?php
class A implements ArrayAccess
{
function offsetGet($a){
return new A;
}
function offsetExists($a){
echo "exists";
if($a === 10){
return true;
}else{
return false;
}
}
function offsetSet($a, $b){}
function offsetUnset($a){}
}
$x = new A;
var_dump($x[10][20] ?? 20);