}
echo "\n";
- $ret = file_put_contents("TEST4", __FILE__);
+ $ret = file_put_contents("TEST4", (binary)__FILE__);
echo "Bool Test: ";
if ($ret !== FALSE && md5(__FILE__) == md5_file("TEST4")) {
echo 'OK';
$fp = fopen("myFile://" . urlencode($tn), "w+");
-fwrite($fp, "line1\n");
-fwrite($fp, "line2\n");
-fwrite($fp, "line3\n");
+fwrite($fp, b"line1\n");
+fwrite($fp, b"line2\n");
+fwrite($fp, b"line3\n");
debug_zval_dump(feof($fp));
rewind($fp);
--FILE--
<?php
$fp = tmpfile();
- fwrite($fp, "this is a lowercase string.\n");
+ fwrite($fp, b"this is a lowercase string.\n");
rewind($fp);
/* Echo out the first four bytes 'this' without applying filter
$fp = fopen($filename, "w");
stream_filter_append($fp, "string.rot13", -49);
-fwrite($fp, "This is a test\n");
+fwrite($fp, b"This is a test\n");
rewind($fp);
fpassthru($fp);
fclose($fp);