note 44857 deleted from language.references.arent by didou
| From: | didou@php.net | Date: | Wed, 18 Aug 2004 10:54:48 +0000 |
| Subject: | note 44857 deleted from language.references.arent by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74872@lists.php.net to get a copy of this message | ||
Note Submitter: salem
----
i don't think that references in PHP are similar to pointers in C. Because when you set a
pointer in C it always points to latest value that the pointed variable has. I mean if "a"
is pointer of "b" and you change the value of "b", "a" still points to
the value that is changed. Shortly, in C, pointer only points to the ADDRESS of variable in memory.
But in PHP, once you write $a=&$b; $a takes the current value of $b at that time and even though
you change the value of $b later, $a stays the same (unlike C).