summaryrefslogtreecommitdiff
path: root/Zend/tests/illegal_offset_unset_isset_empty.phpt
blob: 9005053e67ed8d1b975d81c09a143f308627ead2 (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
--TEST--
Using unset(), isset(), empty() with an illegal array offset throws
--FILE--
<?php

$ary = [];
try {
    unset($ary[[]]);
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    isset($ary[[]]);
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    empty($ary[[]]);
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}

?>
--EXPECT--
Illegal offset type in unset
Illegal offset type in isset or empty
Illegal offset type in isset or empty