[horde] Wrong return statements?

Christoph Fauck christoph.fauck at fauck.info
Thu Apr 17 20:31:09 UTC 2008


Am Donnerstag, 17. April 2008 schrieb Chuck Hagenbuch:
> Quoting Christoph Fauck <christoph.fauck at fauck.info>:
> > This is my first post here. If I'm being conspicuous, be lenient
> > toward so, please:-)
> >
> > I've found some curious return statements like:
> >
> > mail:/usr/share/horde3# grep "return.*=.*new" * -R
> >
> > lib/Horde/Config.php:            return $doc = new
> > Horde_Config_Document($file);
> > lib/Horde/Config.php:        return $root = new
> > Horde_Config_Element($this->node->documentElement);
> > passwd/lib/Driver.php:            return $ret = &new $class($params);
> >
> > Are you sure, that the return satatements are on purpose
>
> Yes.
>
> Are you seeing any particular problem or ... ?
>

If I understand php correctly, the statement

return $root = new anyclass();

returns the success state true/false, if the class was instantiated 
corrrectly. I got some errors, cleanable by

$root = new anyclass();
return $root;

Best regards,
Christoph


More information about the horde mailing list