Ok, I don't have much time do a lot of investigation.
Below goes some recursive code. It causes apache.exe to crash when php5 is loaded as a module and php.exe to crash if the latter is run as a cgi executable.
I find that the problem is in the recursion itself, though other recursive code goes well. Can anybody help?
PHP Code:
function DigCondition() {
static $i=0;
$start = 0;
// DEBUG
static $instance;
$instance ++;
// END DEBUG */
for($i;$i<count($this->tpl_arr);$i++) {
if(preg_match("/{if ([\s\S]+)}/",trim($this->tpl_arr[$i]),$extracted)) {
$start = $i;
$this->DigCondition();
if(!$this->CheckCond($extracted[1])) {
for($j=$start;$j<=$i;$j++) {
$this->tpl_arr[$i]='';
}
}
}
if(preg_match("/{else}/",trim($this->tpl_arr[$i]))) {
}
if(preg_match("/{endif}/",trim($this->tpl_arr[$i]))) {
$this->tpl_arr[$i]='';
return;
}
} //for
} //DigCondition()