<?php class Foo { private $untyped = 'old'; private string $typed = 'old'; public function clear() { unset($this->untyped); unset($this->typed); } public function reinitialise() { $this->typed = 'new'; $this->untyped = 'new'; } } $foo = new Foo; var_dump($foo); $foo->clear(); var_dump($foo); $foo->reinitialise(); var_dump($foo);
You have javascript disabled. You will not be able to edit any code.