ID: 42158 User updated by: chabrol at vfnm dot de Reported By: chabrol at vfnm dot de Status: Wont fix Bug Type: PCRE related Operating System: Linux PHP Version: 5CVS-2007-07-31 (snap) New Comment:
But if it's just a general PHP design problem, why does ereg("/bar/", $xml->name); behaves different than preg_match("/bar/", $xml->name); regarding memory-usage? Previous Comments: ------------------------------------------------------------------------ [2007-08-17 13:42:47] [EMAIL PROTECTED] PHP was never designed for 'long time run'. If you do it, you're totally on your own. And this win32service is PECL thing so any bugs with it should be reported at http://pecl.php.net/bugs/ ------------------------------------------------------------------------ [2007-08-02 15:14:42] chabrol at vfnm dot de Same effect with PHP 6.0.0-dev (php6.0-200708021030.tar.bz2) ------------------------------------------------------------------------ [2007-08-01 07:55:24] chabrol at vfnm dot de Hello Judas! In my case it's an long-term running script (using php-cli). So script shutdown doesn't occur timely. Casting to string looks for me like junst an workaround because 1) other functions like ereg doesn't have the same problem. Try it with ereg("/bar/", $xml->name); instead of preg_match("/bar/", $xml->name); 2) if the engine expects an string and therefore cast the value internally, why should this behave different than casting manually in sight of memory usage? Best regards Daniel Chabrol ------------------------------------------------------------------------ [2007-08-01 07:04:26] ibapty at gmail dot com I can vouch for the workaround based on a similar issue (see http://bugs.php.net/bug.php?id=41911) I encountered. Unfortunately that bug got marked as bogus with a similar explaination. I accept that in 99% of uses of PHP where script shutdown occurs that this type of memory leak is acceptable. However, in my case I am using PHP persistently with the win32service module (php.net/win32service). In the end I have had to setup a routine to restart the service every few minutes to workaround this type of memory leak instead of trying to track them all down. ------------------------------------------------------------------------ [2007-07-31 23:04:51] judas dot iscariote at gmail dot com There is no memory leak, those leaks are reported at script shutdown by the Zend Engine. to fix your problem do this preg_match("/bar/", (string)$xml->name); yes, cast it to string. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/42158 -- Edit this bug report at http://bugs.php.net/?id=42158&edit=1