PHP 5: Class hinting
Class hinting is where the class of object to be passed into a method is specified in the function call. e.g. abstract class User { protected $logState; public function User() { $this->logState = new LogState() } public function setLogstate(LogState $logState) { $this->logState = $logState; } } This code will throw a runtime error if the …