xref: /PHP-8.1/ext/gmp/tests/cast.phpt (revision e9f783fc)
1--TEST--
2GMP casting using casting operators
3--EXTENSIONS--
4gmp
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 bool in %s on line %d
23