1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Files
archived-php-src/ext/gmp/tests/cast.phpt
T
Christoph M. Becker 727b422ad9 Fix #72948: Uncatchable "Catchable" fatal error for class to string conversions
E_RECOVERABLE errors are reported as "Catchable fatal error". This is
misleading, because they actually can't be caught via try-catch statements.
Therefore we change the wording to "Recoverable fatal error" as suggested by
Nikita.
2016-09-03 13:05:37 +02:00

23 lines
395 B
PHP

--TEST--
GMP casting using casting operators
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
--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 boolean in %s on line %d