#38294 [Opn->Bgs]: Doc example problem
| From: | colder@php.net | Date: | Wed, 02 Aug 2006 13:36:42 +0000 |
| Subject: | #38294 [Opn->Bgs]: Doc example problem | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969373638@lists.php.net to get a copy of this message | ||
ID: 38294
Updated by: colder@php.net
Reported By: rejek at sdnet dot pl
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
Operating System: Linux
PHP Version: Irrelevant
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
Using $instance = null won't affect the object itself. $assigned still
holds a reference to the object, as objects are assigned by reference
in PHP5.
Previous Comments:
------------------------------------------------------------------------
[2006-08-02 13:10:28] rejek at sdnet dot pl
In online doc. at:
http://www.php.net/manual/en/language.oop5.basic.php
http://pl.php.net/manual/pl/language.oop5.basic.php
there is the same problem.
MR
------------------------------------------------------------------------
[2006-08-02 12:22:14] rejek at sdnet dot pl
Description:
------------
Look at the Ex. 19-4 in polish ver. of documentation avaible to
download at
http://pl2.php.net/get/php_manual_pl.html.gz/from/pl.php.net/mirror
The line "$instance->var = '$assigned will have this value';"
should be just after "<?PHP" tag to get the expected result given in
the box under ex. code.
I don't know how it looks in other language versions.
Brgs
Mateusz Rejek
Reproduce code:
---------------
<?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);
?>
Expected result:
----------------
NULL NULL object(stdClass)#1 (1) { ["var"]=> string(30) "$assigned
will have this value" }
Actual result:
--------------
NULL NULL NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38294&edit=1