php-src/ext/intl/tests/formatter_clone_bad_obj.phpt
Gina Peter Banyard 33f1cf202e
ext/intl: Various refactoring (#14360)
* ext/intl: Small extension cleanup

* ext/intl: Normalize cloning error handling behaviour

Always throw a Error exception as we cannot progress from here

* ext/intl: idn.c use ValueErrors where appropriate

Drive-by refactoring

* ext/intl: Remove some unused headers

Probably more cleanup can be done
2024-05-30 12:51:36 +01:00

21 lines
349 B
PHP

--TEST--
Cloning uninitialized NumberFormatter
--EXTENSIONS--
intl
--FILE--
<?php
class A extends NumberFormatter {
function __construct() {}
}
$a = new A;
try {
$b = clone $a;
var_dump($b);
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
Error: Cannot clone uninitialized NumberFormatter