- var_dump: documentation ( source)
<?php
class C implements ArrayAccess {
public function offsetGet($offset)
{
return 'value';
}
public function offsetExists($offset)
{
if ($offset == 'pWithNull') {
return null;
}
if ($offset == 'pWithFalse') {
return false;
}
if ($offset == 'pWithTrue') {
return true;
}
return false;
}
public function offsetSet($offset, $value)
{
// nothing
}
}
$o = new C();
var_dump(
isset($o->pWithFalse),
empty($o->pWithFalse)
);
var_dump(
isset($o->pWithNull),
empty($o->pWithNull)
);
var_dump(
isset($o->pWithTrue),
empty($o->pWithTrue)
);