- var_dump: documentation ( source)
<?php
class Document {
}
class a {
function __construct(array $config) {
}
}
class b extends a {
protected Document $document;
function __construct($document) {
if (is_array($document)) {
// deprecation warning
$this->document = new Document; // get from factory
// do config stuff
return;
}
$this->document = $document;
}
}
$x = new b(new Document);
var_dump($x);