1--TEST-- 2Test isset() function : basic functionality 3--FILE-- 4<?php 5class foo {} 6 7echo "*** Testing isset() : basic functionality ***\n"; 8 9$i = 10; 10$f = 10.5; 11$s = "Hello"; 12$a = array(1,2,3,4,5); 13$b = true; 14$n = NULL; 15$obj = new foo; 16$res = fopen(__FILE__, "r"); 17 18echo "Integer test: " . (isset($i) ? "YES": "NO") . "\n"; 19echo "Float test: " . (isset($f) ? "YES": "NO") . "\n"; 20echo "String test: " . (isset($s) ? "YES": "NO") . "\n"; 21echo "Array test: " . (isset($a) ? "YES": "NO") . "\n"; 22echo "Boolean test: " . (isset($b) ? "YES": "NO") . "\n"; 23echo "Null test: " . (isset($n) ? "YES": "NO") . "\n"; 24echo "Object test: " . (isset($obj) ? "YES": "NO") . "\n"; 25echo "Resource test: " . (isset($res) ? "YES": "NO") . "\n"; 26 27echo "\n\nUnset the variables\n\n"; 28unset($i, $f, $s, $a, $b, $n, $obj, $res); 29 30echo "Integer test: " . (isset($i) ? "YES": "NO") . "\n"; 31echo "Float test: " . (isset($f) ? "YES": "NO") . "\n"; 32echo "String test: " . (isset($s) ? "YES": "NO") . "\n"; 33echo "Array test: " . (isset($a) ? "YES": "NO") . "\n"; 34echo "Boolean test: " . (isset($b) ? "YES": "NO") . "\n"; 35echo "Null test: " . (isset($n) ? "YES": "NO") . "\n"; 36echo "Object test: " . (isset($obj) ? "YES": "NO") . "\n"; 37echo "Resource test: " . (isset($res) ? "YES": "NO") . "\n"; 38?> 39--EXPECT-- 40*** Testing isset() : basic functionality *** 41Integer test: YES 42Float test: YES 43String test: YES 44Array test: YES 45Boolean test: YES 46Null test: NO 47Object test: YES 48Resource test: YES 49 50 51Unset the variables 52 53Integer test: NO 54Float test: NO 55String test: NO 56Array test: NO 57Boolean test: NO 58Null test: NO 59Object test: NO 60Resource test: NO 61