--TEST--
bug #49634 (Segfault throwing an exception in a XSL registered function)
--SKIPIF--
--FILE--
test
XML;
$cDIR = __DIR__;
$sXsl = <<
XSL;
function testFunction($a)
{
throw new Exception('Test exception.');
}
$domXml = new DOMDocument;
$domXml->loadXML($sXml);
$domXsl = new DOMDocument;
$domXsl->loadXML($sXsl);
for ($i = 0; $i < 10; $i++)
{
$xsltProcessor = new XSLTProcessor();
$xsltProcessor->registerPHPFunctions(array('testFunction'));
$xsltProcessor->importStyleSheet($domXsl);
try {
@$xsltProcessor->transformToDoc($domXml);
} catch (Exception $e) {
echo $e,"\n";
}
}
?>
--EXPECTF--
Exception: Test exception. in %s:%d
Stack trace:
#0 [internal function]: testFunction(Array)
#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
#2 {main}
Exception: Test exception. in %s:%d
Stack trace:
#0 [internal function]: testFunction(Array)
#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
#2 {main}
Exception: Test exception. in %s:%d
Stack trace:
#0 [internal function]: testFunction(Array)
#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
#2 {main}
Exception: Test exception. in %s:%d
Stack trace:
#0 [internal function]: testFunction(Array)
#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
#2 {main}
Exception: Test exception. in %s:%d
Stack trace:
#0 [internal function]: testFunction(Array)
#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
#2 {main}
Exception: Test exception. in %s:%d
Stack trace:
#0 [internal function]: testFunction(Array)
#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
#2 {main}
Exception: Test exception. in %s:%d
Stack trace:
#0 [internal function]: testFunction(Array)
#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
#2 {main}
Exception: Test exception. in %s:%d
Stack trace:
#0 [internal function]: testFunction(Array)
#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
#2 {main}
Exception: Test exception. in %s:%d
Stack trace:
#0 [internal function]: testFunction(Array)
#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
#2 {main}
Exception: Test exception. in %s:%d
Stack trace:
#0 [internal function]: testFunction(Array)
#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
#2 {main}