2008-06-18 22:54:28 +08:00
|
|
|
--TEST--
|
2015-04-03 00:52:32 +08:00
|
|
|
SPL: FixedArray: Invalid arguments
|
2008-06-18 22:54:28 +08:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
2015-03-01 21:44:55 +08:00
|
|
|
try {
|
2020-02-04 05:52:20 +08:00
|
|
|
$a = new SplFixedArray(new stdClass);
|
2015-05-17 05:49:14 +08:00
|
|
|
} catch (TypeError $iae) {
|
2020-02-04 05:52:20 +08:00
|
|
|
echo "Ok - ".$iae->getMessage().PHP_EOL;
|
2015-03-01 21:44:55 +08:00
|
|
|
}
|
2015-04-03 00:52:32 +08:00
|
|
|
|
|
|
|
try {
|
2020-02-04 05:52:20 +08:00
|
|
|
$a = new SplFixedArray('FOO');
|
2015-05-17 05:49:14 +08:00
|
|
|
} catch (TypeError $iae) {
|
2020-02-04 05:52:20 +08:00
|
|
|
echo "Ok - ".$iae->getMessage().PHP_EOL;
|
2015-03-01 21:44:55 +08:00
|
|
|
}
|
|
|
|
|
2015-04-03 00:52:32 +08:00
|
|
|
try {
|
2020-02-04 05:52:20 +08:00
|
|
|
$a = new SplFixedArray('');
|
2015-05-17 05:49:14 +08:00
|
|
|
} catch (TypeError $iae) {
|
2020-02-04 05:52:20 +08:00
|
|
|
echo "Ok - ".$iae->getMessage().PHP_EOL;
|
2015-04-03 00:52:32 +08:00
|
|
|
}
|
2008-06-18 22:54:28 +08:00
|
|
|
|
|
|
|
?>
|
2015-04-03 00:52:32 +08:00
|
|
|
--EXPECT--
|
2020-05-26 01:28:15 +08:00
|
|
|
Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, stdClass given
|
2020-02-26 03:58:33 +08:00
|
|
|
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
|