php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42126 size of the file differ, when created using file_put_content() on php6
Submitted: 2007-07-27 12:02 UTC Modified: 2008-02-17 01:00 UTC
From: kraghuba at in dot ibm dot com Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 6CVS-2007-07-27 (snap) OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kraghuba at in dot ibm dot com
New email:
PHP Version: OS:

 

 [2007-07-27 12:02 UTC] kraghuba at in dot ibm dot com
Description:
------------
file created using file_get_contents() function differ in size on php6 with unicode switched on. The difference is 1.

Reproduce code:
---------------
<?php
$data = <<<EOT
<test>Testing fgetss() functions</test>
test
EOT;

$filename = "test.txt";
file_put_contents($filename, $data);
var_dump( filesize($filename) );
?>

Expected result:
----------------
int(44)

Actual result:
--------------
int(45)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-28 14:20 UTC] judas dot iscariote at gmail dot com
I just compiled a fresh CVS snap and works for me.. 

/sapi/cli/php -dunicode.semantics=1 put.php


int(44)
 [2008-02-09 19:07 UTC] felipe@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php6.0-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php6.0-win32-latest.zip


 [2008-02-17 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 16:01:37 2025 UTC