The function parse_users
returns an array.
I am doing the following in another function:
return reset($this->parse_users($records));
But I get a Strict Standards: Only variables should be passed by reference in...
Is it because I do a reset()
on the function?
Do I have to do it this way:
$users = $this->parse_users($records);
return reset($users);
Or is something else?
Strict warnings are sent by PHP when certain old features are used or some code doesn't otherwise adhere to php's strict standards. In general, these errors are only helpful in development and can be ignored in production. In PHP 5.4, the E_STRICT error type was set to output by default.
Hi just to make it little ease, for those who are using wamp, you can disable errors by clicking php > php settings >> display errors. If it is checked then uncheck it.
That's it exactly. reset
takes a reference to an array as a parameter, so it basically needs a real variable to reference -- even if it is a pass-by-reference value.
why didn't you try your
$users = $this->parse_users($records);
return reset($users);
?
It's correct
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With