xref: /PHP-7.1/ext/gmp/tests/cast.phpt (revision 7af945e2)
1--TEST--
2GMP casting using casting operators
3--SKIPIF--
4<?php if (!extension_loaded("gmp")) print "skip"; ?>
5--FILE--
6<?php
7
8$n = gmp_init(42);
9echo $n, "\n";
10var_dump((string) $n);
11var_dump((int) $n);
12var_dump((float) $n);
13var_dump((bool) $n);
14
15?>
16--EXPECTF--
1742
18string(2) "42"
19int(42)
20float(42)
21
22Recoverable fatal error: Object of class GMP could not be converted to boolean in %s on line %d
23