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".
31 lines
664 B
PHP
31 lines
664 B
PHP
--TEST--
|
|
SPL: FixedArray: Invalid arguments
|
|
--FILE--
|
|
<?php
|
|
|
|
try {
|
|
$a = new SplFixedArray(new stdClass);
|
|
} catch (TypeError $iae) {
|
|
echo "Ok - ".$iae->getMessage().PHP_EOL;
|
|
}
|
|
|
|
try {
|
|
$a = new SplFixedArray('FOO');
|
|
} catch (TypeError $iae) {
|
|
echo "Ok - ".$iae->getMessage().PHP_EOL;
|
|
}
|
|
|
|
try {
|
|
$a = new SplFixedArray('');
|
|
} catch (TypeError $iae) {
|
|
echo "Ok - ".$iae->getMessage().PHP_EOL;
|
|
}
|
|
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
Ok - SplFixedArray::__construct() expects parameter 1 to be int, object given
|
|
Ok - SplFixedArray::__construct() expects parameter 1 to be int, string given
|
|
Ok - SplFixedArray::__construct() expects parameter 1 to be int, string given
|
|
===DONE===
|