Re: [DOC-LICENSE] about php manual Classes and Objects (PHP 5) Example#5 Object Assignment
[email protected] (Daniel Brown) Mon, 12 Jul 2010 09:20:17 -0400
| Newsgroups | php.doc.license |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> 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!
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/