The 'function' pattern will match function calls like 'register_shutdown_function'

Refine the pattern to '\(^\|\s\)function\s' to avoid these errors.