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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2021 The PHP Group
All rights reserved.
Last updated: Wed Mar 03 08:01:25 2021 UTC