1
votes

I'm a bit confused by the error I am getting.

The error is:

Strict Standards: Only variables should be passed by reference in functions.php

The line in reference is:

$action = array_pop($a = explode('?', $action)); // strip parameters
3

3 Answers

3
votes

Try this:

$a= explode('?',$action);
$action = array_pop($a);

By the way, what is $action?

0
votes

array_pop the only parameter is an array passed by reference. The return value of explode("?", $action) does not have any reference.

You should store the return value to a variable first:

$arr = explode('?',$action);
$action = array_pop($arr);

The following things can be passed by reference:

  • Variables, i.e. foo($a)
  • New statements, i.e. foo(new foobar())
  • References returned from functions

Passing by Reference in PHP Manual

0
votes

$action = array_pop($a = explode('?', $action)); ///Wrong

$action = array_pop($a = (explode('?', $action))); ///Right

Makesure you put explode in brackets like (explode()), that's it..