1

Having this:

...
private $responseBuffer = array();
...

and within this line:

$lm = end(array_values($this->responseBuffer));

I get

Error: Only variables should be passed by reference (2048)

as both end and array_values are built in and do not have a call-by-referenceI'm puzzled, any one an idea?

(purpose: get the latest value out of $responseBuffer)

Axel Amthor
  • 10,980
  • 1
  • 25
  • 44

1 Answers1

5

end function receives the arguement by reference, do like this:

$var = array_values($this->responseBuffer);
$lm = end($var);
xurshid29
  • 4,172
  • 1
  • 20
  • 25