Re: cvs: pear /Image_Graph/Graph Common.php

From: Date: Wed, 22 Mar 2006 22:29:11 +0000
Subject: Re: cvs: pear /Image_Graph/Graph Common.php
References: 1 2  Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-39257@lists.php.net to get a copy of this message
I'm not sure which part you do not like. Since the _setParent() is complaining about not receiving a variable for pass by reference, I guess $this is not a "real" variable. What else is there to do than assign it to a variable? I mean the incredibly ugly thing in the first place is the need to use ampersands to avoid PHP4's fantastic copy-of-assignments, or am I completely off here!? /Jesper Lukas Kahwe Smith wrote:
Jesper Veggerby Hansen wrote:
nosey        Wed Mar 22 22:03:43 2006 UTC
  Modified files:                  /pear/Image_Graph/Graph    Common.php   Log:
  Fixed a PHP5 Notice (Only variable references should be returned by reference)
@@ -124,7 +124,8 @@
             $keys = array_keys($this->_elements);
             foreach ($keys as $key) {
                 if (is_object($this->_elements[$key])) {
-                    $this->_elements[$key]->_setParent($this);
+                    $this_ =& $this;
+                    $this->_elements[$key]->_setParent($this_);
                     $result =& $this->_elements[$key]->_reset();
                     if (PEAR::isError($result)) {
                         return $result;
this looks like an incredibly ugly hack .. itsnt there a cleaner way to do what you need? regards, Lukas


« previous php.pear.cvs (#39257) next »