Annotation of embedaddon/php/ext/gmp/tests/bug32773.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #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
! 7: echo '10 + 0 = ', gmp_strval(gmp_add(10, 0)), "\n";
! 8: echo '10 + "0" = ', gmp_strval(gmp_add(10, '0')), "\n";
! 9:
! 10: echo gmp_strval(gmp_div(10, 0))."\n";
! 11: echo gmp_strval(gmp_div_qr(10, 0))."\n";
! 12:
! 13: ?>
! 14: --EXPECTF--
! 15: 10 + 0 = 10
! 16: 10 + "0" = 10
! 17:
! 18: Warning: gmp_div(): Zero operand not allowed in %s on line %d
! 19: 0
! 20:
! 21: Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d
! 22: 0
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>