xref: /PHP-7.2/ext/spl/tests/fixedarray_005.phpt (revision 64b167d2)
1--TEST--
2SPL: FixedArray: Invalid arguments
3--FILE--
4<?php
5
6try {
7	$a = new SplFixedArray(new stdClass);
8} catch (TypeError $iae) {
9	echo "Ok - ".$iae->getMessage().PHP_EOL;
10}
11
12try {
13	$a = new SplFixedArray('FOO');
14} catch (TypeError $iae) {
15	echo "Ok - ".$iae->getMessage().PHP_EOL;
16}
17
18try {
19	$a = new SplFixedArray('');
20} catch (TypeError $iae) {
21	echo "Ok - ".$iae->getMessage().PHP_EOL;
22}
23
24?>
25===DONE===
26--EXPECT--
27Ok - SplFixedArray::__construct() expects parameter 1 to be integer, object given
28Ok - SplFixedArray::__construct() expects parameter 1 to be integer, string given
29Ok - SplFixedArray::__construct() expects parameter 1 to be integer, string given
30===DONE===
31