mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
ce1d69a1f6
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".
37 lines
965 B
PHP
37 lines
965 B
PHP
--TEST--
|
|
IntlCalendar::clear(): bad arguments
|
|
--INI--
|
|
date.timezone=Atlantic/Azores
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('intl'))
|
|
die('skip intl extension not enabled');
|
|
--FILE--
|
|
<?php
|
|
ini_set("intl.error_level", E_WARNING);
|
|
|
|
$c = new IntlGregorianCalendar(NULL, 'pt_PT');
|
|
|
|
var_dump($c->clear(1, 2));
|
|
var_dump($c->clear(-1));
|
|
|
|
var_dump(intlcal_clear($c, -1));
|
|
var_dump(intlcal_clear(1, 2));
|
|
--EXPECTF--
|
|
Warning: IntlCalendar::clear() expects at most 1 parameter, 2 given in %s on line %d
|
|
|
|
Warning: IntlCalendar::clear(): intlcal_clear: bad arguments in %s on line %d
|
|
bool(false)
|
|
|
|
Warning: IntlCalendar::clear(): intlcal_clear: invalid field in %s on line %d
|
|
bool(false)
|
|
|
|
Warning: intlcal_clear(): intlcal_clear: invalid field in %s on line %d
|
|
bool(false)
|
|
|
|
Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_clear() must be an instance of IntlCalendar, int given in %s:%d
|
|
Stack trace:
|
|
#0 %s(%d): intlcal_clear(1, 2)
|
|
#1 {main}
|
|
thrown in %s on line %d
|