Re: DB_DataObject_Formbuilder calltime pass-by-reference

From: Date: Wed, 29 Dec 2004 14:12:37 +0000
Subject: Re: DB_DataObject_Formbuilder calltime pass-by-reference
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-35267@lists.php.net to get a copy of this message
Sönke Ruempler wrote:
Hi folks, [Wed Dec 29 08:46:00 2004] [error] PHP Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /usr/lib/php/DB/DataObject/FormBuilder.php on line 1652 I use the latest CVS - the Code is:
        if (method_exists($this->_do, 'postgenerateform')) {
            $this->_do->postGenerateForm(&$obj, &$this);
        }
Could you please fix that? Thx :)
Hi Sönke, I've been asked to fix this quite often, but I don't think it's possible to do so, because in some PHP versions the object simply won't get passed by reference even though there is and ampersand in the function declaration of postGenerateForm(). I have no idea why this is the case and frankly, I don't have time to test each PHP version since 4.3.0 to see if the bug disappears in one of those later versions (and stays that way). Also (from what I've been told) in case you use overloading, this is the only way passing something by reference will work regardless of what version of PHP4 you're using. And that is very unlikely to change. PHP5 solves this problem though. The easiest way around this is to change the config setting. Alternatively, you can simply remove the ampersands before $obj and $this and see if it works for you with your PHP version. If someone who is more proficient with the internals of PHP4 can shed a bit more light on this, that would really be great. CU Markus

« previous php.pear.dev (#35267) next »