summaryrefslogtreecommitdiff
path: root/ext/gmp/tests
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2005-04-25 12:18:50 +0000
committerStanislav Malyshev <stas@php.net>2005-04-25 12:18:50 +0000
commitb86bab9735115e2145a926a69e14caebaca684b0 (patch)
tree189545d1e662577ca735b2aaa2f4ee905a37ec0d /ext/gmp/tests
parentf150ee9ab5187f273091905b8071f1c2c7a319af (diff)
downloadphp-git-b86bab9735115e2145a926a69e14caebaca684b0.tar.gz
@- Fix #32773 and make right fix for GMP FPEs (Stas)
Fix #32773 and make right fix for GMP FPEs
Diffstat (limited to 'ext/gmp/tests')
-rw-r--r--ext/gmp/tests/bug32773.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/gmp/tests/bug32773.phpt b/ext/gmp/tests/bug32773.phpt
new file mode 100644
index 0000000000..0890362c7d
--- /dev/null
+++ b/ext/gmp/tests/bug32773.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #32773 binary GMP functions returns unexpected value, when second parameter is int(0)
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--POST--
+--GET--
+--FILE--
+<?
+echo '10 + 0 = ', gmp_strval(gmp_add(10, 0)), "\n";
+echo '10 + "0" = ', gmp_strval(gmp_add(10, '0')), "\n";
+
+echo gmp_strval(gmp_div(10, 0))."\n";
+echo gmp_strval(gmp_div_qr(10, 0))."\n";
+
+?>
+--EXPECTF--
+10 + 0 = 10
+10 + "0" = 10
+
+Warning: gmp_div(): Zero operand not allowed in %s on line %d
+0
+
+Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d
+0