xref: /PHP-5.6/ext/gmp/tests/bug32773.phpt (revision 1f655451)
1--TEST--
2Bug #32773 (binary GMP functions returns unexpected value, when second parameter is int(0))
3--SKIPIF--
4<?php if (!extension_loaded("gmp")) print "skip"; ?>
5--FILE--
6<?php
7echo '10 + 0 = ', gmp_strval(gmp_add(10, 0)), "\n";
8echo '10 + "0" = ', gmp_strval(gmp_add(10, '0')), "\n";
9
10echo gmp_strval(gmp_div(10, 0))."\n";
11echo gmp_strval(gmp_div_qr(10, 0))."\n";
12
13?>
14--EXPECTF--
1510 + 0 = 10
1610 + "0" = 10
17
18Warning: gmp_div(): Zero operand not allowed in %s on line %d
190
20
21Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d
220
23