A client of mine just upgraded to the latest snapshot of PHP 5.0.5-dev and started getting errors when node_invoke() is called:

Fatal error: Only variables can be passed by reference in c:\drupal\modules\node.module on line 702.

This patch fixes the problem by assigning the value to a variable before passing it to node_invoke().

Thanks.

CommentFileSizeAuthor
node_invoke.diff858 bytesdanielc

Comments

dries’s picture

This can't be true ...

danielc’s picture

What "can't be true?"

// Under PHP php5.0-win32-200506251630
function foo(&$bar) {
}
foo('x');

Fatal error: Only variables can be passed by reference in test.php on line 5

--Dan

PS: Congratulations on your wedding!

danielc’s picture

And I believe these references issues (here and in http://drupal.org/node/26033 and http://drupal.org/node/26034)
will also come up with the just released PHP 4.4.0.

sjaensch’s picture

I can confirm this with PHP 5.1.0b2 and current CVS, will this patch be merged?

dcook’s picture

This happens in a lot of places throughout Drupal. So far, I've done the same thing (save the result to a temp variable, then pass the temp variable to the function) in the following places:

system.module line 25
system.module line 653
user.module line 1293

danielc’s picture

Status: Needs review » Closed (duplicate)

This issue will be addressed by a mega-patch applied in http://drupal.org/node/26033.