1--TEST-- 2Check xsltprocessor::registerPHPFunctions and a undefined php function 3--DESCRIPTION-- 4The XSL script tries to call a php function that is not defined 5--SKIPIF-- 6<?php 7 if (!extension_loaded('xsl')) { 8 die("skip\n"); 9 } 10?> 11--FILE-- 12<?php 13include dirname(__FILE__) .'/prepare.inc'; 14$phpfuncxsl = new domDocument(); 15$phpfuncxsl->load(dirname(__FILE__)."/phpfunc-undef.xsl"); 16if(!$phpfuncxsl) { 17 echo "Error while parsing the xsl document\n"; 18 exit; 19} 20$proc->importStylesheet($phpfuncxsl); 21var_dump($proc->registerPHPFunctions()); 22var_dump($proc->transformToXml($dom)); 23--EXPECTF-- 24NULL 25 26Warning: XSLTProcessor::transformToXml(): Unable to call handler undefinedfunc() in %s on line %d 27 28Warning: XSLTProcessor::transformToXml(): xmlXPathCompiledEval: evaluation failed in %s on line %d 29 30Warning: XSLTProcessor::transformToXml(): runtime error: file %s line %d element value-of in %s on line %d 31 32Warning: XSLTProcessor::transformToXml(): XPath evaluation returned no result. in %s on line %d 33NULL 34--CREDITS-- 35Christian Weiske, cweiske@php.net 36PHP Testfest Berlin 2009-05-09 37