func_get_args would only return declared parameters when used inside of namespaces. This allows it to work correctly in that case. Closes #832