- var_dump: documentation ( source)
<?php
declare(strict_types=1); // so only PHP 7 will show up
class FooBar {
private $x;
public function __construct() {
var_dump($this);
unset($this->x); // I can remove a property!
var_dump($this); // It's gone!
$this->x = 2; // I can recreate a property!
var_dump($this); // The "new" property retains the "old" property's visibilty. Good job.
}
}
$foobar = new Foobar;