]> granicus.if.org Git - php/commitdiff
fix gmp_gcdext() in Unicode mode
authorAntony Dovgal <tony2001@php.net>
Thu, 19 Apr 2007 09:36:34 +0000 (09:36 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 19 Apr 2007 09:36:34 +0000 (09:36 +0000)
ext/gmp/gmp.c
ext/gmp/tests/022.phpt

index 7f386e699770a620ccd596fc39c565d3cb50a5f3..dca90ac1a47df2047776bc0b3f1a62eff1e6a35b 100644 (file)
@@ -1271,11 +1271,11 @@ ZEND_FUNCTION(gmp_gcdext)
        array_init(return_value);
 
        ZEND_REGISTER_RESOURCE(&r, gmpnum_g, le_gmp);
-       add_assoc_resource(return_value, "g", Z_LVAL(r));
+       add_ascii_assoc_resource(return_value, "g", Z_LVAL(r));
        ZEND_REGISTER_RESOURCE(&r, gmpnum_s, le_gmp);
-       add_assoc_resource(return_value, "s", Z_LVAL(r));
+       add_ascii_assoc_resource(return_value, "s", Z_LVAL(r));
        ZEND_REGISTER_RESOURCE(&r, gmpnum_t, le_gmp);
-       add_assoc_resource(return_value, "t", Z_LVAL(r));
+       add_ascii_assoc_resource(return_value, "t", Z_LVAL(r));
 }
 /* }}} */
 
index 0df874dc7d0142c1231bd13e8f1118a3b0cab4aa..6b1f9f52928b1f709cf68dc979e016fe9cd131c2 100644 (file)
@@ -81,3 +81,50 @@ NULL
 Warning: Wrong parameter count for gmp_gcdext() in %s on line %d
 NULL
 Done
+--UEXPECTF--
+unicode(1) "3"
+unicode(2) "-4"
+unicode(2) "11"
+unicode(1) "1"
+unicode(4) "-805"
+unicode(3) "359"
+unicode(1) "3"
+unicode(2) "32"
+unicode(5) "-2257"
+unicode(4) "3003"
+unicode(3) "-10"
+unicode(2) "19"
+unicode(1) "2"
+unicode(2) "67"
+unicode(2) "-3"
+unicode(2) "15"
+unicode(7) "-601519"
+unicode(1) "6"
+unicode(3) "345"
+unicode(1) "1"
+unicode(1) "0"
+unicode(1) "1"
+unicode(5) "84319"
+unicode(9) "-84241831"
+unicode(1) "1"
+unicode(13) "-156252240050"
+unicode(14) "16689072773537"
+unicode(3) "195"
+unicode(11) "46994884483"
+unicode(9) "-68772552"
+
+Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+
+Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+
+Warning: Wrong parameter count for gmp_gcdext() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for gmp_gcdext() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for gmp_gcdext() in %s on line %d
+NULL
+Done