blob: 3b777e9357855007565763870d59d13848c6db03 (
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
--TEST--
Test isset() function : basic functionality
--FILE--
<?php
class foo {}
echo "*** Testing isset() : basic functionality ***\n";
$i = 10;
$f = 10.5;
$s = "Hello";
$b = true;
$n = NULL;
echo "Test multiple scalar variables in a group\n";
var_dump(isset($i, $f, $s, $b));
var_dump(isset($i, $f, $s, $b, $n));
echo "Unset a few\n";
unset($i, $b);
echo "Test again\n";
var_dump(isset($i, $f, $s, $b));
echo "\n\nArray test:\n";
$arr = array();
var_dump(isset($var));
var_dump(isset($var[1]));
var_dump(isset($var, $var[1]));
echo "..now set\n";
$var[1] = 10;
var_dump(isset($var));
var_dump(isset($var[1]));
var_dump(isset($var, $var[1]));
?>
--EXPECT--
*** Testing isset() : basic functionality ***
Test multiple scalar variables in a group
bool(true)
bool(false)
Unset a few
Test again
bool(false)
Array test:
bool(false)
bool(false)
bool(false)
..now set
bool(true)
bool(true)
bool(true)
|