Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Fate Error: Only variables can be passed by reference
Index -> Programming, PHP -> PHP Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Amailer




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
beard0




PostPosted: Sun Sep 25, 2005 11:51 pm   Post subject: (No 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.
wtd




PostPosted: Mon Sep 26, 2005 11:04 am   Post subject: (No 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.
Amailer




PostPosted: Mon Sep 26, 2005 6:07 pm   Post subject: (No subject)

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

Thanks.
Display posts from previous:   
   Index -> Programming, PHP -> PHP Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: