summaryrefslogtreecommitdiff
path: root/ext/spl/tests/fixedarray_005.phpt
blob: 573a995cb1fcde9bbb80d922297057fa3a44ec0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--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, object 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