note 41114 added to language.references
| From: | iryokuatterradotes at rn2 dot php dot net | Date: | Tue, 30 Mar 2004 15:22:18 +0000 |
| Subject: | note 41114 added to language.references | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67387@lists.php.net to get a copy of this message | ||
You should have in mind that php4 keep assigned variables "automagically" referenced until
they are overwritten. So the variable copy is not executed on assignment, but on modification. Say
you have this:
$var1 = 5;
$var2 = $var1; // In this point these two variables share the same memory location
$var1 = 3; // Here $var1 and $var2 have they own memory locations with values 3 and 5 respectively
Don't use references in function parameters to speed up aplications, because this is
automatically done. I think that this should be in the manual, because it can lead to confusion.
More about this here:
http://www.zend.com/zend/art/ref-count.php
----
Manual Page -- http://www.php.net/manual/en/language.references.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41114
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41114&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41114&report=yes
Search -- http://master.php.net/manage/user-notes.php