mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
-test for more than one argument (this segfaulted before)
This commit is contained in:
parent
0a210d7976
commit
c9bd0195a3
@ -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
|
||||
|
@ -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)"/>
|
||||
|
Loading…
Reference in New Issue
Block a user