summaryrefslogtreecommitdiff
path: root/ext/sqlite3/php_sqlite3.h
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-03-19 13:06:21 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-03-19 13:06:21 +0100
commit4fe3d108af2b0a1e8810959fe1ea7a0b52291ad7 (patch)
treec6325dd574d98e6fa37987af558e08f5b932fe4b /ext/sqlite3/php_sqlite3.h
parent38b16274d16f3a90dd42e340b8429041c6aa7365 (diff)
downloadphp-git-4fe3d108af2b0a1e8810959fe1ea7a0b52291ad7.tar.gz
Don't create a new array for empty/null match every time
If PREG_OFFSET_CAPTURE is used, unmatched subpatterns will be either [null, -1] or ['', -1] depending on PREG_UNMATCHED_AS_NULL mode. Instead of creating a new array like this every time, cache it inside a global (per-request -- could make it immutable though). Additionally check whether the subpattern is an empty string or single character string and use an existing interned string in that case. Empty / single-char subpatterns are common, so let's avoid allocating strings for them.
Diffstat (limited to 'ext/sqlite3/php_sqlite3.h')
0 files changed, 0 insertions, 0 deletions