- var_dump: documentation ( source)
<?php
class A {
public int $a;
public function __construct(int $a = 1) {
$this->a = $a;
}
}
class B extends A {
public string $b;
public function __construct(string $b = 'hello') {
$this->b = $b;
}
}
$b = new B();
$b->a=1;
var_dump($b->a, $b->b);