누군가 나에게 설명 할 수 있습니까?
이 두 가지 방법의 차이점은 무엇입니까?
function some_function($foo)
{
}
내 경우
function some_function(foo $foo)
{
}
는
public function validate_something(notice $notice, $tok_id, $captcha)
{
if(something === true) {
$notice->add('info', 'Info message');
} else {
$notice->add('error', 'Error message');
}
}
$ 고지 그것은라고
class notice {
private $_notice = array();
public function get_notice(){
return $this->_notice;
}
public function add($type, $message) {
$this->_notice[$type][] = $message;
}
...
}