I have a legacy text filter, which uses preg_replace_callback
for parsing. However, when the parsed text is too complex, the code dies with no error message given, except for this PHP log entry WARNING: [pool www] child ... exited on signal 11
.
To illustrate the problem, run the following code with values 10 and 20 in the $rows
variable:
<?php
function my_callback(&$matches) {
return $matches[0];
}
$regex = '#^\{\|(.*?)(?:^\|\+(.*?))?(^(?:((?R))|.)*?)^\|}#msi';
$columns = '';
$rows = 10; // 20 causes WSOD with no error given
for ($i=0; $i<20; $i++) {
$columns .= "| style=\"width:6em\" | $i\n";
}
$body = "{|\n" . implode("|-\n", array_fill(0, $rows, $columns)) . "\n|}";
print preg_replace_callback($regex, 'my_callback', $body);
How do I increase the correcponding resource limit (assuming there is some) the code is hitting? Any help highly appreciated!