]> granicus.if.org Git - php/commitdiff
-test for more than one argument (this segfaulted before)
authorChristian Stocker <chregu@php.net>
Sun, 18 Jan 2004 12:30:52 +0000 (12:30 +0000)
committerChristian Stocker <chregu@php.net>
Sun, 18 Jan 2004 12:30:52 +0000 (12:30 +0000)
ext/xsl/tests/xslt011.phpt
ext/xsl/tests/xslt011.xsl

index 4691df0a98f07977351ec2dd1eb845155247875e..46adfef5dbab83ca6ce9c09f40f34a2ab437557d 100644 (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
index 2d5773f962efd00919fee00e888f28cf342aae6b..55609bbeaa822fcabcafbe5d4b781d7e13906ac5 100644 (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)"/>