[Bug 369737] Re: preg_replace_callback segfaults
Andreas Olsson
andreas at arrakis.se
Fri May 1 14:42:56 BST 2009
Can you provide the PHP code which causes this segfault?
I tried the following example code, and managed to run
preg_replace_callback() just fine on both an i386 and an amd64 running
jaunty.
<?php
// this text was used in 2002
// we want to get this up to date for 2003
$text = "April fools day is 04/01/2002\n";
$text.= "Last christmas was 12/24/2001\n";
// the callback function
function next_year($matches)
{
// as usual: $matches[0] is the complete match
// $matches[1] the match for the first subpattern
// enclosed in '(...)' and so on
return $matches[1].($matches[2]+1);
}
echo preg_replace_callback(
"|(\d{2}/\d{2}/)(\d{4})|",
"next_year",
$text);
?>
(Taken from http://www.php.net/manual/en/function.preg-replace-
callback.php)
** Changed in: php5 (Ubuntu)
Status: New => Incomplete
--
preg_replace_callback segfaults
https://bugs.launchpad.net/bugs/369737
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to php5 in ubuntu.
More information about the Ubuntu-server-bugs
mailing list