could someone explain this to me?
What is the difference of these two methods?
function some_function($foo)
{
}
and
function some_function(foo $foo)
{
}
in my case
public function validate_something(notice $notice, $tok_id, $captcha)
{
if(something === true) {
$notice->add('info', 'Info message');
} else {
$notice->add('error', 'Error message');
}
}
$notice is a object of class notice
class notice {
private $_notice = array();
public function get_notice(){
return $this->_notice;
}
public function add($type, $message) {
$this->_notice[$type][] = $message;
}
...
}