note 48203 deleted from language.references.unset by sean
| From: | sean@php.net | Date: | Wed, 31 Aug 2005 17:18:37 +0000 |
| Subject: | note 48203 deleted from language.references.unset by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-94533@lists.php.net to get a copy of this message | ||
Note Submitter: mangelp at ieee dot org
----
Bishop: Sorry but you are making a mistake.
When you do this:
<?php
$orig = 1;
$ref = &$orig;
?>
You have two variables that point to the same content. So if you unset one of them you are only
erasing one of the references (take a look at the documentation above) not erasing the content
itself. The content is erased when it is no more references left.
If what you wanted was to delete completely the content, not the references to the content, you
should do what you proposed setting to null the content.
This will make that every reference acts like there wheren't set to any value, but this is only
a fake because the content is the null value.