임 라인에서 점점 오류 4PHP 함수 오류 T_FUNCTION
구문 분석 오류 : 구문 오류, C에서 예상치 못한 T_FUNCTION : \ XAMPP \ htdocs에 라인에서 작업 \ CASC의 \ 관리 \ 양식 - validator.php \ 21
누구든지 도와 드릴 수 있습니까?
public function email($message='')
{
$message = (empty ($message)) ? '%s is an invalid email address.' : $message;
$this->set_rule(__FUNCTION__, function($email) {
return (filter_var($email, FILTER_VALIDATE_EMAIL) === FALSE) ? FALSE : TRUE;
}, $message);
return $this;
}
private function set_rule($rule, $function, $message='')
{
// do not attempt to validate when no post data is present
if ($this->haspostdata) {
if (! array_key_exists($rule, $this->rules)) {
$this->rules[$rule] = TRUE;
if (! array_key_exists($rule, $this->functions) && is_callable($function)) {
$this->functions[$rule] = $function;
}
if (!empty ($message)) {
$this->messages[$rule] = $message;
}
}
}
}
는'set_rule이다()'두번째 인수로 폐쇄를 기대? – stillstanding
PHP> = 5.3을 사용하고 있습니까? – KingCrunch
질문을 편집했습니다. 지금 확인하십시오. –