Req #32458 [Opn]: preg_split return only offsets

From: Date: Mon, 18 Mar 2019 16:17:30 +0000
Subject: Req #32458 [Opn]: preg_split return only offsets
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220056@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=32458&edit=1 ID: 32458 Updated by: nikic@php.net Reported by: pornel at despammed dot com Summary: preg_split return only offsets Status: Open Type: Feature/Change Request Package: PCRE related Operating System: all PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Related to bug #77744. I don't understand why one would want to have this behavior on preg_split() though, rather than preg_match()/preg_match_all(). Previous Comments: ------------------------------------------------------------------------ [2005-03-25 21:45:08] pornel at despammed dot com New parameter, "start at", that causes command to ignore number of initial chars, would nicely complement this feature. ------------------------------------------------------------------------ [2005-03-25 21:38:11] pornel at despammed dot com Description: ------------ PREG_SPLIT_OFFSET_CAPTURE is useful for creation of custom parsers - allows to find positions of matching strings. If offset is known - returned string is not needed, as it might be accessed in various other ways. I suggest adding flag PREG_SPLIT_OFFSETS_ONLY (or PREG_SPLIT_NO_CAPTURE) that would (hopefully) boost performance when preg_split is used to tokenize long strings. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=32458&edit=1

« previous php.bugs (#220056) next »