PHP:自定义菜单中的严格标准错误


PHP: strict standard error in a customised menu

请帮助更正以下代码:

> PHP Strict Standards: Only variables should be passed by reference in /home/xxxxxx/public_html/app/mods/Controller/Menu.php on line 15

代码如下:

public function __call($function, $parameters){
    $categoria = strtolower(str_replace('Action',NULL,$function));
    $platillo = strtolower(array_pop( array_flip($_GET)));//line 15

提前感谢

array_pop需要对变量的引用。引用意味着它必须是一个变量——也就是说,你可以这样做:

$x = ["a", "b"];
array_pop($x);

但不是

array_pop(["a","b"]);

因此,为了解决您的问题,您可以执行以下操作:

$flipped_get = array_flip($_GET);
$platillo = strtolower(array_pop($flipped_get));//line 15