mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
e9f783fcdd
For rationale, see #6787 Extensions migrated in part 3: * ftp * gmp * iconv * opcache * shmop
23 lines
346 B
PHP
23 lines
346 B
PHP
--TEST--
|
|
GMP casting using casting operators
|
|
--EXTENSIONS--
|
|
gmp
|
|
--FILE--
|
|
<?php
|
|
|
|
$n = gmp_init(42);
|
|
echo $n, "\n";
|
|
var_dump((string) $n);
|
|
var_dump((int) $n);
|
|
var_dump((float) $n);
|
|
var_dump((bool) $n);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
42
|
|
string(2) "42"
|
|
int(42)
|
|
float(42)
|
|
|
|
Recoverable fatal error: Object of class GMP could not be converted to bool in %s on line %d
|