# [PATCH] pcre caching and memory

- Thread: https://externals.io/message/10662
- Original archive: https://news-web.php.net/php.internals/10662
- Started by Curt Zirzow on 2004-06-20T19:06:29+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #10662 — Curt Zirzow — 2004-06-20T19:06:29+00:00

URL: https://externals.io/message/10662#10662

Problem:

  Php will allocate a new pcre object for each different regular
  expression. Since the allocated memory is outside the zend memory
  system, php can eat up lots of memory, and potentially eventually
  exhausting the memory.


The patch I wrote introduces a new flag 'z', which enables the user
to opt out of php caching the regular expression. 


Patch:
  http://zirzow.dyndns.org/patches/preg/php_pcre.patch

Examples:
  http://zirzow.dyndns.org/patches/preg/pcre_memory.phps
  http://zirzow.dyndns.org/patches/preg/pcre_fixed.phps



Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!
