Get rid of "Strict Standards: Only variables should be passed by reference"


Well-known member
The development environment is now tossing a strict standards error after upgrading to PHP 5.4 in ZendServer, XF 1.2.3, WordPress 3.8 beta-1, and the plugin I'm re-writing.

// Strict Standards: Only variables should be passed by reference happens here
   if($forumModel->canPostThreadInForum($forum, $errorPhraseKey = '')) {
How can the array be rewritten? Stackoverflow threads discuss defining an intermediate variable. I've tried a few ways but then end up with a call-time by reference error, and few others (depending on my attempts).

Thank you for any advice.


Well-known member
This is another place this code is tossing a strict standards message:

if( $threadModel->canReplyToThread($thread, $forum, $errorKey = '') )


Well-known member
I looked around and saw most posts did not include the $errorKey. Removed that part (since it was the cause of the message) and things appear to work.

So - my question becomes - what does that errorKey do? :)


Well-known member
You just need to remove this:
= ''
Don't try to define the variable it when you call the method.

As far as what it's for, it will contain an error if there is one.