1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/gmp/tests/comparison_invalid.phpt
Nikita Popov d43bc343ab Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix bug #81119
2021-06-10 14:48:06 +02:00

24 lines
461 B
PHP

--TEST--
Invalid comparison with a GMP object
--EXTENSIONS--
gmp
--FILE--
<?php
try {
var_dump("hapfegfbu" > gmp_init(0));
} catch (\Error $e) {
echo $e::class, ': ', $e->getMessage(), \PHP_EOL;
}
try {
var_dump((new DateTime()) > gmp_init(0));
} catch (\Error $e) {
echo $e::class, ': ', $e->getMessage(), \PHP_EOL;
}
?>
--EXPECT--
ValueError: Number is not an integer string
TypeError: Number must be of type GMP|string|int, DateTime given