- var_dump: documentation ( source)
<?php
class Foo {
const BAR = 'bar';
var $other = 'test';
}
function getFoo() {
return new Foo();
}
// var_dump(getFoo()::BAR); // Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM)
var_dump(getFoo()::BAR); // NULL (Notice: Undefined property Foo::$BAR)
var_dump(getFoo()->other); // string(4) "test"
$foo = getFoo();
var_dump($foo->other);
var_dump($foo::BAR); // string(3) "bar"