|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46503 PCRE objects in addition to the existing functions
Submitted: 2008-11-06 13:23 UTC Modified: 2010-12-20 15:50 UTC
Avg. Score:4.0 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: glideraerobatics at hotmail dot com Assigned:
Status: Open Package: PCRE related
PHP Version: 5.2.6 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-11-06 13:23 UTC] glideraerobatics at hotmail dot com
Most (if not all) other languages (such as javascript, Perl using the qr// operator) that support PCRE regular expressions have some means of creating pre-compiled PCRE objects. 

These are very useful in that these objects can be passed around inside an application into functions that require a valid regular expression as argument. Using a PCRE object, these functions just have use the 'instance of' operator in order to make sure that the arguments are of the correct type.

Pre-compiled PCRE objects can also boost performance in the sense that the expression is compiled once where needed, used one or more times and then disposed of. Sounds similar to how SQL statements are or should be used. I assume that PHP currently compiles and caches string type regular expressions internally so in that case the only performance advantage will be the disposing of the unused regexp.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-20 15:50 UTC]
-Package: Feature/Change Request +Package: PCRE related
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Jan 27 08:01:26 2021 UTC