Edit report at https://bugs.php.net/bug.php?id=55842&edit=1
ID: 55842 Updated by: [email protected] 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
