1--TEST--
2Test isset() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : bool isset  ( mixed $var  [, mixed $var  [,  $...  ]] )
6 * Description:  Determine if a variable is set and is not NULL
7 */
8
9class foo {}
10
11echo "*** Testing isset() : basic functionality ***\n";
12
13$i = 10;
14$f = 10.5;
15$s = "Hello";
16$b = true;
17$n = NULL;
18
19echo "Test multiple scalar variables in a group\n";
20var_dump(isset($i, $f, $s, $b));
21var_dump(isset($i, $f, $s, $b, $n));
22
23echo "Unset a few\n";
24unset($i, $b);
25
26echo "Test again\n";
27var_dump(isset($i, $f, $s, $b));
28
29echo "\n\nArray test:\n";
30$arr = array();
31var_dump(isset($var));
32var_dump(isset($var[1]));
33var_dump(isset($var, $var[1]));
34echo "..now set\n";
35$var[1] = 10;
36var_dump(isset($var));
37var_dump(isset($var[1]));
38var_dump(isset($var, $var[1]));
39
40?>
41===DONE===
42--EXPECT--
43*** Testing isset() : basic functionality ***
44Test multiple scalar variables in a group
45bool(true)
46bool(false)
47Unset a few
48Test again
49bool(false)
50
51
52Array test:
53bool(false)
54bool(false)
55bool(false)
56..now set
57bool(true)
58bool(true)
59bool(true)
60===DONE===