Testing Empty String and empty var Empty has no value assigned (ie, empty), Foo has a value, NotExist doesn't exist Some of these tests are pretty silly ---------------------------------------------------------------------------------- Testing == '' [1] Empty == '' PASS FAIL - empty string should equal empty string [1] [2] Foo == '' FAIL - existing var shouldn't equal empty string [2] PASS [3] NotExist == '' FAIL - non-existing should be NULL, not empty string [3] PASS Testing != '' [4] Empty != '' FAIL - Empty var should equal empty string [4] PASS [5] Foo != '' PASS FAIL - [5] [6] NotExist != '' PASS - Non existing var doesn't equal empty string FAIL - [6] Testing ? [7] ?Empty PASS FAIL - [7] [8] ?Foo PASS FAIL - [8] [9] ?NotExist FAIL - non existing var shouldn't exist [9] PASS Testing ! [10] !Empty PASS FAIL - [10] [11] !Foo FAIL - existing string shouldn't evaluate false [11] PASS [12] !NotExist PASS FAIL - [12] Testing !? [13] !?Empty FAIL - empty string shouldn't evaluate non-existing [13] PASS [14] !?Foo FAIL - non-empty string shouldn't evaluate non-existing [14] PASS [15] !?NotExist PASS FAIL - [15] Testing ?! - Existance only works on a var, otherwise always returns true, so ?! is always true [16] ?!Empty PASS FAIL - [16] [17] ?!Foo PASS FAIL - [17] [18] ?!NotExist PASS FAIL - [18] Testing ? and == '' - boolean vs. equality? um... boolean is a number, so these are numeric evals, and empty string is 0 [19] ?Empty == '' FAIL - IF boolean true equals empty [19] PASS - ELSE boolean true doesn't equal empty (1 != 0) [20] ?Foo == '' FAIL - IF boolean true equals empty [20] PASS - ELSE boolean true doesn't equal empty (1 != 0) [21] ?NotExist == '' PASS - IF boolean false equals empty (0 == 0) [22] FAIL - ELSE boolean false doesn't equal empty [22] Testing ? and != '' - boolean vs. in-equality? um... [23] ?Empty != '' PASS - IF boolean true not equal empty (1 != 0) FAIL - ELSE boolean true equals empty [23] [24] ?Foo != '' PASS - IF boolean true not equal empty (1 != 0) FAIL - ELSE boolean true equals empty [24] [25] ?NotExist != '' FAIL - IF boolean false not equal empty [25] PASS - ELSE boolean false equals empty (0 == 0) Testing !? and == '' - all boolean true equals empty [26] !?Empty == '' PASS - IF boolean true equals empty FAIL - ELSE boolean true doesn't equal empty [26] [27] !?Foo == '' PASS - IF boolean true equals empty FAIL - ELSE boolean true doesn't equal empty [27] [28] !?NotExist == '' FAIL - IF boolean true equals empty [28] PASS - ELSE boolean true doesn't equal empty Testing !? and != '' [29] !?Empty != '' FAIL - IF boolean true not equal empty [29] PASS - ELSE boolean true equals empty [30] !?Foo != '' FAIL - IF boolean true not equal empty [30] PASS - ELSE boolean true equals empty [31] !?NotExist != '' PASS - IF boolean true not equal empty FAIL - ELSE boolean true equals empty [31]