After the linux file is operated through PHP file_put_contents, the size of the file is twice as large as the number of bytes written

$str = "aaa" . "\n";
echo file_put_contents("/tmp/log", $str, FILE_APPEND); //4

after querying through the linux command, the screenshot is as follows

I hope Daniel can help me answer my question about why the size of the file is growing by twice the number of bytes written

.
Apr.04,2021

FILE_APPEND is the append flag. If there is content in it will be directly appended, you cat this file to see if the content is aaa+ enter?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3342a-2abc4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3342a-2abc4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?