func_get_arg() cannot be called from the global scope

Description

func_get_arg() returns the list of arguments used when calling a function or method. As such, it must be inside a function to be useful.

Example

<?php

func_get_arg(0);

?>

Solutions

  • Remove func_get_arg() calls from the global space (outside any function).

  • Move the func_get_arg() calls inside a function.