Connecting Tech Pros Worldwide Forums | Help | Site Map

PHP error regarding Arrays

Newbie
 
Join Date: Mar 2007
Posts: 16
#1: Jan 24 '08
I use function to change a password in an xml file using simplexml. It works fine on my local server, as well as from the remote server when I use firefox, But for some reason, when I use IE and test the remote page it gives me the following error:

Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in somepath.php on line 530

Here is the code snippet it points to:

Expand|Select|Wrap|Line Numbers
  1. if ($changes['newpass'][0] == $changes['newpass'][1])
  2.             {
  3.                 $match = true;
  4.  
  5. /* line530*/        $xml->user[$index]->password = $changes['newpass'][0];
  6.                 $xml->user[$index]->username = $changes['username'];
  7.                 $xml->asXML(LOGIN_PATH);
  8.                 $ret = '<h3 style="text-align:center">Username and Password Updated Successfully!</h3>'.LINE_BREAK.
  9.                         '<a class="acceptlink" href="index.php">Back</a>';
}

pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#2: Jul 6 '08

re: PHP error regarding Arrays


Heya, James.

Are you using the ArrayAccess or ArrayObject interface (http://php.net/manual/en/class.arrayobject.php)? There are some known issues with it in PHP v5.0.x:

I doubt this, but SimpleXML *might* have inherited the same issues that SPL did in PHP 5.0. Try upgrading your PHP installation.
Reply