From http://php.net/manual/en/function.split.php:

Tip: preg_split(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to split(). If you don't require the power of regular expressions, it is faster to use explode(), which doesn't incur the overhead of the regular expression engine.

The "regular expression" used is '\[', which evaluates to the literal '['. So instead of queuing up the regular expression engine, use the significantly faster explode().

Bonus points are garnered by the more recent tip:

Note: As of PHP 5.3.0 the regex extension is deprecated, calling this function will issue an E_DEPRECATED notice.

Comments

Status: Needs review » Needs work

The last submitted patch failed testing.

jrchamp’s picture

Issue tags: +Quick fix
StatusFileSize
new1.09 KB

Rerolling.

jrchamp’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch failed testing.

jrchamp’s picture

Status: Needs work » Needs review
StatusFileSize
new1.09 KB

Rerolling against HEAD.

damien tournoud’s picture

Status: Needs review » Reviewed & tested by the community

Doh!

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix

Automatically closed -- issue fixed for 2 weeks with no activity.