cvs: smarty /docs programmers.sgml
| From: | Monte Ohrt | Date: | Wed, 12 Mar 2003 00:14:34 +0000 |
| Subject: | cvs: smarty /docs programmers.sgml | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-450@lists.php.net to get a copy of this message | ||
mohrt Tue Mar 11 19:14:34 2003 EDT
Modified files:
/smarty/docs programmers.sgml
Log:
update technical explanation of assign_by_ref and append_by_ref
Index: smarty/docs/programmers.sgml
diff -u smarty/docs/programmers.sgml:1.28 smarty/docs/programmers.sgml:1.29
--- smarty/docs/programmers.sgml:1.28 Tue Mar 4 12:47:50 2003
+++ smarty/docs/programmers.sgml Tue Mar 11 19:14:32 2003
@@ -548,25 +548,17 @@
</funcprototype>
</funcsynopsis>
<para>
- This is used to append values to the templates by reference instead of
- making a copy. See the PHP manual on variable referencing for an
- explanation. If you pass the optional third parameter of true, the value
- will be merged with the current array instead of appended.
+ This is used to append values to the templates by reference.
+ If you append a variable by reference then change its
+ value, the appended value sees the change as well. For objects,
+ append_by_ref() also avoids an in-memory copy of the appended object.
+ See the PHP manual on variable referencing for an in-depth
+ explanation. If you pass the optional third parameter of true,
+ the value will be merged with the current array instead of appended.
</para>
<note>
<title>Technical Note</title>
<para>
- append_by_ref() is more efficient than append() since it does not create
- an in-memory copy of the variable. Instead it refers to the actual
- variable in the memory heap. Be aware if you alter the original variable
- after it is assigned, the assigned variable sees the changes! PHP 5.0
- will take care of referencing automatically, so this function acts as a
- workaround.
- </para>
- </note>
- <note>
- <title>Technical Note</title>
- <para>
The merge parameter respects array keys, so if you merge two
numerically indexed arrays, they may overwrite each other or result in
non-sequential keys. This is unlike the array_merge() function of PHP
@@ -626,12 +618,12 @@
<note>
<title>Technical Note</title>
<para>
- assign_by_ref() is more efficient than assign() since it does not create
- an in-memory copy of the variable. Instead it refers to the actual
- variable in the memory heap. Be aware if you alter the original variable
- after it is assigned, the assigned variable sees the changes! PHP 5.0
- will take care of referencing automatically, so this function acts as a
- workaround.
+ This is used to assign values to the templates by reference.
+ If you assign a variable by reference then change its
+ value, the assigned value sees the change as well. For objects,
+ assign_by_ref() also avoids an in-memory copy of the assigned object.
+ See the PHP manual on variable referencing for an in-depth
+ explanation.
</para>
</note>
<example>