php.net |  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
Votes:3
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: glideraerobatics at hotmail dot com
New email:
PHP Version: OS:

 

 [2008-11-06 13:23 UTC] glideraerobatics at hotmail dot com
Description:
------------
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.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-20 15:50 UTC] jani@php.net
-Package: Feature/Change Request +Package: PCRE related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 05:01:26 2019 UTC