From:             [EMAIL PROTECTED]
Operating system: Linux (Redhat 6.2) on an i686
PHP version:      4.0.4pl1
PHP Bug Type:     Scripting Engine problem
Bug description:  Passing out class property by reference problem

        function xmpdump($xValue, $sLabel="")
                echo "$sLabel<xmp>";
                echo "</xmp>";

        class test
                var $sValue;
                var $Count = 0;
                function getTest(&$refObj)
                        if (isset($this->sValue))
                                $refObj = &$this->sValue;
                                xmpdump($refObj, "Reference before being passed back");
                                $refObj = "phil".$this->Count;
                                $this->sValue = &$refObj;
                                xmpdump($refObj, "Value before being passed back");
        $tst = new test();

        xmpdump($tstObj0, "Value after being passed back");
        xmpdump($tstObj1, "Refence after being passed back");

The dump of $tstObj1 is NULL, despite the dump of $refObj immediately before it in the 
function working correctly.

Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to