- var_dump: documentation ( source)
<?php
class MyParent {
protected $x = "parent";
public function __construct() {
$this->x = "parent - construct";
}
}
class MyChild extends MyParent {
protected $x = "child";
public function __construct() {
var_dump($this->x);
$this->x = "child - construct";
var_dump($this->x);
$closure = function () {
var_dump($this->x);
};
$closure = $closure->bindTo($this, parent::class);
$closure();
}
}
new MyChild;