- print_r: documentation ( source)
- var_export: documentation ( source)
- printf: documentation ( source)
<?php
declare(strict_types=1);
class Dummy { }
class Parental {
public function __set($name, $val) {
printf("Setting %s to %s\n", $name, var_export($val, true));
$this->{$name} = $val;
}
}
class Demo extends Parental {
private Dummy $x;
public function test() {
$this->x = new Dummy();
}
}
$d = new Demo();
$d->test();
print_r($d);