PHP 4.0 Bug #9643: Variable member value gets lost from object during use
| From: | robsta at bigfoot dot com | Date: | Fri, 09 Mar 2001 01:07:48 +0000 |
| Subject: | PHP 4.0 Bug #9643: Variable member value gets lost from object during use | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-48343@lists.php.net to get a copy of this message | ||
From: robsta@bigfoot.com
Operating system: Debian 2.2 testing/unstable 2.2.18
PHP version: 4.0.4pl1
PHP Bug Type: Class/Object related
Bug description: Variable member value gets lost from object during use
Also running Zend optimiser 1.0. Removing the optimiser makes no difference to the outcome.
The problem should hopefully be outlined in the cut and paste of the code below. There are no other
operations occurring on any of the instantiated objects at the time:
-----------------------------
$crList = $this -> getLinkedCRs (); // method returns an array of instantiated objects (CRRecord
class).
foreach ($crList as $cr)
{
if (!$cr -> okToClose ()) // method returns a Boolean, and sets a Boolean data member in the cr
object.
{
return false;
}
}
foreach ($crList as $cr)
{
// Previously set Boolean data member now appears to no longer be set.
$cr -> okToClose (); // Inserting the method call in again here ensures that the following
method call works.
$cr -> close ($changeBy); // method operates only if the previously set Boolean data member is
true.
}
--
Edit Bug report at: http://bugs.php.net/?id=9643&edit=1