- var_dump: documentation ( source)
<?php
class Foo {
}
class Bar {
const SOMECLASS = 'Foo';
protected $instance;
public function __construct()
{
$instance = static::SOMECLASS;
$this->instance = new $instance;
}
}
var_dump(new Bar);