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
Comment #2
jrchamp commentedRerolling.
Comment #3
jrchamp commentedComment #5
jrchamp commentedRerolling against HEAD.
Comment #6
damien tournoud commentedDoh!
Comment #7
dries commentedCommitted to CVS HEAD. Thanks.