Re: Sv: Re: [SMARTY] assign_by_ref() and append_by_ref()
| From: | Monte Ohrt | Date: | Sat, 03 Aug 2002 17:43:42 +0000 |
| Subject: | Re: Sv: Re: [SMARTY] assign_by_ref() and append_by_ref() | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5579@lists.php.net to get a copy of this message | ||
Taken from php.ini:
; Whether to enable the ability to force arguments to be passed by reference
; at function call time. This method is deprecated and is likely to be
; unsupported in future versions of PHP/Zend. The encouraged method of
; specifying which arguments should be passed by reference is in the function
; declaration. You're encouraged to try and turn this option Off and make
; sure your scripts work properly with it in order to ensure they will work
; with future versions of the language (you will receive a warning each time
; you use this feature, and the argument will be passed by value instead of by
; reference).
allow_call_time_pass_reference = On
Ferdinand Beyer wrote:
On 3 Aug 2002 at 10:48, Monte Ohrt wrote:-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.They do not recommend pass-by-reference at call time, it will probably be deprecated. So don't do this: my_func(&$var); function my_func($var) { } instead do this: my_func($var); function my_func(&$var) { }I don't understand the reason for not allowing this. So if you want to implement a stack class with push(), pop(), peek(), shift(), unshift(), etc., do you have to define each function twice if you want to enable but not force references??? I asked it in the Zend Engine2 mailing list (engine2@lists.zend.com), but I did not receive any answer yet. Do you now the answer?