mirror of
https://github.com/php/php-src.git
synced 2025-01-05 18:33:56 +08:00
fbe30592d6
From now on, we always display the given object's type instead of just reporting "object". Additionally, make the format of return type errors match the format of argument errors. Closes GH-5625
29 lines
695 B
PHP
29 lines
695 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;
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, stdClass given
|
|
Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, string given
|
|
Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, string given
|