kelt
public php v1 · immutable class foo { public function dostuff(){ print $this->myvar; } private $myvar; } $test1 = new foo(); $test2 = new stdClass(); $test2->myvar = "something"; $test1 = $test2; $test1->dostuff(); # Fatal error: Call to undefined method stdClass::dostuff()