mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00

PHP requires integer typehints to be written "int" and does not allow "integer" as an alias. This changes type error messages to match the actual type name and avoids confusing messages like "must be of the type integer, integer given".
34 lines
1.2 KiB
PHP
34 lines
1.2 KiB
PHP
--TEST--
|
|
IntlTimeZone::getEquivalentID(): errors
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('intl'))
|
|
die('skip intl extension not enabled');
|
|
--FILE--
|
|
<?php
|
|
ini_set("intl.error_level", E_WARNING);
|
|
|
|
var_dump(IntlTimeZone::getEquivalentID('foo'));
|
|
var_dump(IntlTimeZone::getEquivalentID('foo', 'bar'));
|
|
var_dump(IntlTimeZone::getEquivalentID('Europe/Lisbon', 0, 1));
|
|
var_dump(IntlTimeZone::getEquivalentID("foo\x80", 0));
|
|
|
|
--EXPECTF--
|
|
|
|
Warning: IntlTimeZone::getEquivalentID() expects exactly 2 parameters, 1 given in %s on line %d
|
|
|
|
Warning: IntlTimeZone::getEquivalentID(): intltz_get_equivalent_id: bad arguments in %s on line %d
|
|
bool(false)
|
|
|
|
Warning: IntlTimeZone::getEquivalentID() expects parameter 2 to be int, string given in %s on line %d
|
|
|
|
Warning: IntlTimeZone::getEquivalentID(): intltz_get_equivalent_id: bad arguments in %s on line %d
|
|
bool(false)
|
|
|
|
Warning: IntlTimeZone::getEquivalentID() expects exactly 2 parameters, 3 given in %s on line %d
|
|
|
|
Warning: IntlTimeZone::getEquivalentID(): intltz_get_equivalent_id: bad arguments in %s on line %d
|
|
bool(false)
|
|
|
|
Warning: IntlTimeZone::getEquivalentID(): intltz_get_equivalent_id: could not convert time zone id to UTF-16 in %s on line %d
|
|
bool(false)
|