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: 2021-02-01 15:20 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: Suspended Package: PCRE related
PHP Version: 5.2.6 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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
 [2021-02-01 15:20 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2021-02-01 15:20 UTC] cmb@php.net
ext/pcre already caches compiled patterns, but clearly, an OOP API
would have further advantages.  However, the details of that API
would need to be layed out and discussed as an RFC.  Feel free to
start the RFC process[1].  For the time being, I'm suspending this
ticket.

[1] <https://wiki.php.net/rfc/howto>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC