ID:               20064
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Verified
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: W2K
 PHP Version:      4.3.0-dev
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The 1st instance of recursion is always shown. Consider
print_r($GLOBALS);


Previous Comments:
------------------------------------------------------------------------

[2002-10-24 12:21:04] [EMAIL PROTECTED]

Running the code below shows that $cls->tProperty is _NOT_ the same
variable as the object itself. However, it should be. It lies that
$cls->tProperty is another instance of tClass class. Despite of this,
when one changes the name property, it will result in change in both
objects, and that's correct.


class tClass {
        var $tProperty;
        var $name;
        function tClass() {
                $this->tProperty =& $this;
        }
};

echo "<pre>";
$cls =& new tClass();
$cls->name = "Sam";
print_r($cls);
$cls->name = "George";
print_r($cls);
echo "</pre>";

/*
----------------------------
Output:
----------------------------
tclass Object
(
    [tProperty] => tclass Object
        (
            [tProperty] =>  *RECURSION*
            [name] => Sam
        )

    [name] => Sam
)
tclass Object
(
    [tProperty] => tclass Object
        (
            [tProperty] =>  *RECURSION*
            [name] => George
        )

    [name] => George
)


----------------------------
Instead of:
----------------------------
tclass Object
(
    [tProperty] => *RECURSION*
    [name] => Sam
)
tclass Object
(
    [tProperty] => *RECURSION*
    [name] => George
)


*/

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=20064&edit=1

Reply via email to