note 61358 deleted from function.array by tularis

From: Date: Wed, 01 Feb 2006 16:32:36 +0000
Subject: note 61358 deleted from function.array by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-102818@lists.php.net to get a copy of this message
Note Submitter: goldt at goldt dot org Reason: useless ---- Cannot use assign-op operators with overloaded objects nor string offsets After upgrading PHP to the newest version this error occurs every now and then. In my case i got the error in this code: foreach ($serviceCenter as $scname) { $failed[$scname]=0; $passed[$scname]=0; $almostfailed[$scname]=0; } Not always but randomly the above error message appears. For this simple case the fix is to declare the arrays $failed=array(); $passed=array(); $almostfailed=array(); before entering the loop. But it would be difficult for multi dimensional arrays. Also the error message gives a line number somewhere after the loop so it makes it hard to track.

« previous php.notes (#102818) next »