Annotation of embedaddon/php/ext/standard/tests/general_functions/isset_basic2.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test 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:
! 9: class foo {}
! 10:
! 11: echo "*** Testing isset() : basic functionality ***\n";
! 12:
! 13: $i = 10;
! 14: $f = 10.5;
! 15: $s = "Hello";
! 16: $b = true;
! 17: $n = NULL;
! 18:
! 19: echo "Test multiple scalar variables in a group\n";
! 20: var_dump(isset($i, $f, $s, $b));
! 21: var_dump(isset($i, $f, $s, $b, $n));
! 22:
! 23: echo "Unset a few\n";
! 24: unset($i, $b);
! 25:
! 26: echo "Test again\n";
! 27: var_dump(isset($i, $f, $s, $b));
! 28:
! 29: echo "\n\nArray test:\n";
! 30: $arr = array();
! 31: var_dump(isset($var));
! 32: var_dump(isset($var[1]));
! 33: var_dump(isset($var, $var[1]));
! 34: echo "..now set\n";
! 35: $var[1] = 10;
! 36: var_dump(isset($var));
! 37: var_dump(isset($var[1]));
! 38: var_dump(isset($var, $var[1]));
! 39:
! 40: ?>
! 41: ===DONE===
! 42: --EXPECT--
! 43: *** Testing isset() : basic functionality ***
! 44: Test multiple scalar variables in a group
! 45: bool(true)
! 46: bool(false)
! 47: Unset a few
! 48: Test again
! 49: bool(false)
! 50:
! 51:
! 52: Array test:
! 53: bool(false)
! 54: bool(false)
! 55: bool(false)
! 56: ..now set
! 57: bool(true)
! 58: bool(true)
! 59: bool(true)
! 60: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>