weird php syntax: Functions within functions