- var_dump: documentation ( source)
<?php
abstract class AbstractFoo
{
public $bar;
final public function __construct()
{
$this->bar = static::BAR;
}
}
class FooBar extends AbstractFoo
{
const BAR = 'foobar';
}
class Foo extends AbstractFoo
{
//const BAR = 'foobar';
}
$fooBar = new FooBar();
var_dump($fooBar->bar);
$foo = new Foo();
var_dump($foo->bar);