Php Declare Function Inside Another Function