#44072 [Opn->Fbk]: substr don't work correctly with binary string

From: Date: Sun, 24 Feb 2008 20:04:40 +0000
Subject: #44072 [Opn->Fbk]: substr don't work correctly with binary string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-122653@lists.php.net to get a copy of this message
 ID:               44072
 Updated by:       jani@php.net
 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:

Can you just provide the script and data in e.g. zip package somewhere
where anyone can download it from? (those urls above are not working)

And shell access is not necessary for simple thing like
this..especially when I'm 99% sure you're just doing something wrong..
:)


Previous Comments:
------------------------------------------------------------------------

[2008-02-19 15:21:43] sergey89 at gmail dot com

> How do you know that the md5 sum for that part should be exactly
that?
I ran script on other PHP version and other OSes

PHP Script source: http://test.sergey89.net/test.php.txt
File containing data: http://test.sergey89.net/data
Result: http://test.sergey89.net/test.php

We can give you ftp/ssh access to test yourself.

------------------------------------------------------------------------

[2008-02-18 10:51:32] jani@php.net

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..

------------------------------------------------------------------------

[2008-02-15 15:13:33] sergey89 at gmail dot com

The version and build are the same.

------------------------------------------------------------------------

[2008-02-15 14:27:22] jani@php.net

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.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/44072

-- 
Edit this bug report at http://bugs.php.net/?id=44072&edit=1


Thread (10 messages)

« previous php.bugs (#122653) next »