Computer Science Canada

Fate Error: Only variables can be passed by reference

Author:  Amailer [ Sun Sep 25, 2005 3:45 pm ]
Post subject:  Fate Error: Only variables can be passed by reference

Quote:
Fatal error: Only variables can be passed by reference in C:\wwwroot\hosted\aov\modules\clan\module_clan.php on line 295


I just upgraded my PHP to 5.0.5 and now I started getting this on my phpBB boards and etc...

It seems that I cannot like..trim a variable when feeding it to a function.. (example)

cannot do wrote:
submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), $message, str_replace("\'", "''", $poll_title), $poll_options, $poll_length);


what I have to do wrote:
$message = str_replace("\'", "''",addslashes($message));
$poll_title = str_replace("\'", "''", $poll_title);
$username = str_replace("\'", "''", $username);
$subject = str_replace("\'", "''", $subject);

submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, $username, $subject, $message, $poll_title, $poll_options, $poll_length);


o.O why..... is this happning????
Why isn't it allowed anymore.... is there a way aroudn this?

Author:  beard0 [ Sun Sep 25, 2005 11:51 pm ]
Post subject: 

Can you post the submit_post() function? That may lead to some sort of explanation. Right now I'm wondering about modified parameters, and if 5.0.5 is doing something weird with them, which is making you uncontiously define your parameters as such.

Author:  wtd [ Mon Sep 26, 2005 11:04 am ]
Post subject: 

It's expecting arguments to be passed by reference, possibly to avoid copying large amounts of data. Only variables can be passed by reference, and not simple values.

I'm afraid there's no way around this one.

Author:  Amailer [ Mon Sep 26, 2005 6:07 pm ]
Post subject: 

Ah wow thats just great Confused phpBB did that in a ton of places... gatta go change it now.

Thanks.


: