Bug #76185 [Opn->Fbk]: preg_split Removes Empty lines when flag is not set

From: Date: Thu, 05 Apr 2018 00:10:55 +0000
Subject: Bug #76185 [Opn->Fbk]: preg_split Removes Empty lines when flag is not set
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214606@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76185&edit=1

 ID:                 76185
 Updated by:         requinix@php.net
 Reported by:        will at bisbeefamily dot com
 Summary:            preg_split Removes Empty lines when flag is not set
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            *General Issues
 Operating System:   Windows 10/Apache
 PHP Version:        5.6.35
 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.

But did you know that \s will match newline characters?


Previous Comments:
------------------------------------------------------------------------
[2018-04-04 23:58:05] will at bisbeefamily dot com

Description:
------------
$parts = preg_split( "#^\s*%(\w+):#sm", $buffer, null,
PREG_SPLIT_OFFSET_CAPTURE|PREG_SPLIT_DELIM_CAPTURE ); 

Removes empty lines between the split targets even though the PREG_SPLIT_NO_EMPTY flag is not set.




Test script:
---------------
         



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



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


Thread (5 messages)

« previous php.bugs (#214606) next »