All,

The manual currently doesn't specify what the function file_put_contents 
returns beyond just "int".  The code prototype says string, and the function 
appears to return a boolean rather than any integer (at least in the latest 
CVS).  Which of the three should it be?

I was /expecting/ it to return an integer of the number of bytes written, as 
in the included (albeit very simplistic!) patch.


Paul
--

[EMAIL PROTECTED] standard]$ diff -u file.c.old file.c
--- file.c.old  2003-06-28 01:13:19.000000000 +0100
+++ file.c      2003-06-28 01:13:29.000000000 +0100
@@ -474,7 +474,7 @@
 }
 /* }}} */

-/* {{{ proto string file_put_contents(string file, string data[, int flags[, 
resource context]])
+/* {{{ proto int file_put_contents(string file, string data[, int flags[, 
resource context]])
    Write/Create a file with contents data */
 PHP_FUNCTION(file_put_contents)
 {
@@ -506,7 +506,7 @@
        }
        php_stream_close(stream);

-       RETURN_TRUE;
+       RETURN_LONG(numbytes);
 }
 /* }}} */

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to