By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,521 Members | 1,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,521 IT Pros & Developers. It's quick & easy.

Fatal error: Cannot re-assign $this

P: 4
Fatal error: Cannot re-assign $this in C:\Inetpub\vhosts\default.com\httpdocs\new\kd_xmlr pc.php on line 453

Expand|Select|Wrap|Line Numbers
  1. function XMLRPC_error($faultCode, $faultString, $server = NULL){
  2.     $array["methodResponse"]["fault"]["value"]["struct"]["member"] = array();
  3.     $this = &$array["methodResponse"]["fault"]["value"]["struct"]["member"];
  4.     $this[0]["name"] = "faultCode";
  5.     $this[0]["value"]["int"] = $faultCode;
  6.     $this[1]["name"] = "faultString";
  7.     $this[1]["value"]["string"] = $faultString;
  8.  
  9.     $return = XML_serialize($array);

How do I fix this problem? also, clarify why this problem happens?
May 24 '10 #1
Share this Question
Share on Google+
1 Reply


Markus
Expert 5K+
P: 6,050
Well, as the error says, you cannot reassign the variable $this. In PHP, $this is a special variable; it refers to the current object of a class, and, as such, you cannot modify what it points to.

What are you trying to do? If I understood, I could offer an alternative.
May 24 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.