mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00

The existing code is extremely convoluted, incorrectly documented, and does not follow the usual semantics
22 lines
629 B
PHP
22 lines
629 B
PHP
--TEST--
|
|
IntlTimeZone::createEnumeration(): errors
|
|
--EXTENSIONS--
|
|
intl
|
|
--FILE--
|
|
<?php
|
|
|
|
try {
|
|
var_dump(IntlTimeZone::createEnumeration([]));
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
|
|
try {
|
|
var_dump(IntlTimeZone::createEnumeration(new stdClass()));
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
TypeError: IntlTimeZone::createEnumeration(): Argument #1 ($countryOrRawOffset) must be of type string|int|null, array given
|
|
TypeError: IntlTimeZone::createEnumeration(): Argument #1 ($countryOrRawOffset) must be of type string|int|null, stdClass given
|