ID: 44072
Updated by: [EMAIL PROTECTED]
Reported By: sergey89 at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: Strings related
Operating System: FreeBSD 6.3
PHP Version: 5.2.5
New Comment:
How do you know that the md5 sum for that part should be exactly that?
And we can't really test this reliably with some random data..
Previous Comments:
------------------------------------------------------------------------
[2008-02-15 15:13:33] sergey89 at gmail dot com
The version and build are the same.
------------------------------------------------------------------------
[2008-02-15 14:27:22] [EMAIL PROTECTED]
If it works in CLI but not in webserver, then there's propably
something different between those two, maybe PHP version..?*
------------------------------------------------------------------------
[2008-02-14 09:38:55] sergey89 at gmail dot com
I generate data with simple PHP script:
<?php
file_put_contents('data', '');
for ($i = 0; $i < 1024; $i++){
file_put_contents('data', chr(rand(0, 255)), FILE_APPEND);
}
However in php-cli substr work correctly.
------------------------------------------------------------------------
[2008-02-13 18:04:01] [EMAIL PROTECTED]
What exactly IS in that file? It's impossible to test this without the
data..
------------------------------------------------------------------------
[2008-02-07 18:31:06] sergey89 at gmail dot com
Description:
------------
substr don't work correctly with binary strings on FreeBSD 6.3, PHP
5.2.5. I have some binary file. When i tried to cut part of data i get
incorrect result.
-----
mbstring.function_overload 0
Reproduce code:
---------------
<?php
$data = file_get_contents('data');
print md5($data) . ' | ';
print md5(substr($data, 0, -88));
?>
Expected result:
----------------
45e26dc33aad8e93f3f45c8d5100feb0 | 03d900cc2ba7276fb3bb3f1939303e3b
Actual result:
--------------
45e26dc33aad8e93f3f45c8d5100feb0 | d1cea9d93cb48b2d897595f5e96ba352
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44072&edit=1