Re: about php manual Classes and Objects (PHP 5) Example#5 Object Assignment

From: Date: Mon, 12 Jul 2010 13:20:17 +0000
Subject: Re: about php manual Classes and Objects (PHP 5) Example#5 Object Assignment
References: 1  Groups: php.doc.license 
Request: Send a blank email to doc-license+get-273@lists.php.net to get a copy of this message
Hello, Monji; The email you sent below was sent to the wrong address. In fact, please don't report bugs on mailing lists, but instead, report all bugs - including problems with the documentation - at http://bugs.php.net/. Your entire original email follows. On Mon, Jul 12, 2010 at 03:32, tatsuki monji <ttskmnj@gmail.com> wrote: > hello. > i'm monji. > i'm really grateful to your php manual. > it helps me to study php. > today i think i found the mistake in Classes and Objects (PHP 5) Example#5 > Object Assignment. > > example is > > <?php > $assigned   =  $instance; > $reference  =& $instance; > > $instance->var = '$assigned will have this value'; > > $instance = null; // $instance and $reference become null > > var_dump($instance); > var_dump($reference); > var_dump($assigned); > ?> > > and it say > > The above example will output: > > NULL > NULL > object(SimpleClass)#1 (1) { >   ["var"]=> >     string(30) "$assigned will have this value" > } > > but it output > NULL > NULL > NULL > > i think example should be like this > >        <?php > >        $instance->var = '$assigned will have this value'; > > >        $assigned   =  $instance; > >        $reference  =& $instance; > > >        $instance = null; // $instance and $reference become null > > >        var_dump($instance); > >        var_dump($reference); > >        var_dump($assigned); > >        ?> > > please check that. > > i'm sorry for my poor english. > -- </Daniel P. Brown> UNADVERTISED DEDICATED SERVER SPECIALS SAME-DAY SETUP Just ask me what we're offering today! daniel.brown@parasane.net || danbrown@php.net http://www.parasane.net/ || http://www.pilotpig.net/

« previous php.doc.license (#273) next »