#29637 [Opn->Bgs]: fwrite needs pass by reference for string
| From: | derick@php.net | Date: | Thu, 12 Aug 2004 18:01:59 +0000 |
| Subject: | #29637 [Opn->Bgs]: fwrite needs pass by reference for string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-64506@lists.php.net to get a copy of this message | ||
ID: 29637
Updated by: derick@php.net
Reported By: pearcec at poss dot com
-Status: Open
+Status: Bogus
Bug Type: Zend Engine 2 problem
Operating System: any
PHP Version: 5.0.0
New Comment:
That is not true, PHP does not copy the data in this case. PHP does a
copy on write, and because the fwrite function does not change the
string nothing will be copied (it's actually more efficient then
passing by reference in this case).
Previous Comments:
------------------------------------------------------------------------
[2004-08-12 18:52:44] pearcec at poss dot com
Description:
------------
It would be great to pass the string by reference in fwrite. Otherwise
it makes a copy of the data. This is a problem for very large files.
PHP Warning: Call-time pass-by-reference has been deprecated -
argument passed by value; If you would like to pass it by reference,
modify the declaration of fwrite(). If you would like to enable
call-time pass-by-reference, you can set allow_call_time_pass_reference
to true in your INI file. However, future versions may not support this
any longer. in /home/pearcec/saturn/www/include/file/cnFileBlob.inc on
line 156
Reproduce code:
---------------
fwrite($fp, $inContents);
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29637&edit=1