-test for more than one argument (this segfaulted before)

This commit is contained in:
Christian Stocker 2004-01-18 12:30:52 +00:00
parent 0a210d7976
commit c9bd0195a3
2 changed files with 6 additions and 6 deletions

View File

@ -18,11 +18,11 @@ $dom = new domDocument();
$xml = new DomDocument();
$xml->load(dirname(__FILE__)."/xslt011.xml");
print $proc->transformToXml($xml);
function foobar($id ) {
function foobar($id, $secondArg = "" ) {
if (is_array($id)) {
return $id[0]->value;
return $id[0]->value . " - " . $secondArg;
} else {
return $id;
return $id . " - " . $secondArg;
}
}
function nodeSet($id = null) {
@ -42,8 +42,8 @@ Test 11: php:function Support
Notice: Object of class foo could not be converted to string in %s on line 15
<?xml version="1.0"?>
foobar
foobar
foobar - secondArg
foobar -
this is from an external DomDocument
from the Input Document
Object

View File

@ -4,7 +4,7 @@
xsl:extension-element-prefixes="php"
version='1.0'>
<xsl:template match="/">
<xsl:value-of select="php:functionString('foobar', /doc/@id)"/>
<xsl:value-of select="php:functionString('foobar', /doc/@id, 'secondArg')"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="php:function('foobar', /doc/@id)"/>