File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
standard /
tests /
general_functions /
isset_basic2.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:04 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
Test isset() function : basic functionality
--FILE--
<?php
/* Prototype : bool isset ( mixed $var [, mixed $var [, $... ]] )
* Description: Determine if a variable is set and is not NULL
*/
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]));
?>
===DONE===
--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)
===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>