Bug #55842 [Opn->Fbk]: Explode function sensitive to data!
| From: | pajoye@php.net | Date: | Tue, 04 Oct 2011 12:58:20 +0000 |
| Subject: | Bug #55842 [Opn->Fbk]: Explode function sensitive to data! | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-164078@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55842&edit=1
ID: 55842
Updated by: pajoye@php.net
Reported by: lennart dot ohrstedt at diadoker dot se
Summary: Explode function sensitive to data!
-Status: Open
+Status: Feedback
Type: Bug
Package: Strings related
Operating System: Mac OS x 10.7.1,MAMP 1.9.6
PHP Version: 5.3SVN-2011-10-04 (SVN)
Block user comment: N
Private report: N
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
Previous Comments:
------------------------------------------------------------------------
[2011-10-04 11:38:23] lennart dot ohrstedt at diadoker dot se
Description:
------------
If I have a string containing "<?php" somewhere in the middle and I use explode
to split the string. Then the output array will not have the part of the string
prior to the "<?php", the output array will start at the character following the
"<?php". Is this a bug or this is the way explode works?
Test script:
---------------
use URL www.diadoker.se/test/packa_upp.php. The input file, "test_new.php", to this is a
previus "packed" php-file using "trim", and the output is to file
"test2.php".
Expected result:
----------------
I expected the result to be equal to the input but split according to the
parameters in the explode function.
Actual result:
--------------
When there is the characters "<?php" somewhere in the string, everything before
these characters are lostand the first character in the output array is the
character following the "<?php".
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55842&edit=1