Lines Matching refs:empty

2 Test unset(), empty() and isset() functions
8 Prototype: bool empty( mixed $var );
9 Description: Determine whether a variable is considered to be empty
15 echo "*** Testing unset(), empty() & isset() with scalar variables ***\n";
57 // checking if the var is empty, expected: bool(false) on most
59 var_dump( empty($scalar_var) );
70 // empty to check if empty, expecting bool(true)
71 var_dump( empty($scalar_var) );
81 echo "\n*** Testing unset(), empty() & isset() with arrays ***\n";
92 array(1,2, "One" => "1", 2 => "two", ""=>"empty", "" => '')
103 // check using isset() & empty() on a non_existent element in the array
107 var_dump( empty($array_var['non_existent']) );
109 // testing empty and isset on arrays
110 …var_dump( empty($array_var) ); // expecting bool(false), except: array(), which is considered empty
115 // unset each element in the array and see the working of unset, isset & empty
130 // calling empty, expected bool(true)
131 var_dump( empty($array_var[$key_val]) );
134 // because of using isset, empty and unset on its element
148 // empty() to see if the array is empty
149 var_dump( empty($array_var) ); // expected: bool(true)
166 // check using isset() and empty()
168 var_dump( empty($resource) ); // expected: bool(false)
172 // dump the resource to see using isset() and empty () had no effect on it
177 // check using isset() and empty()
179 var_dump( empty($resource) ); // expected: bool(true)
195 var_dump( empty($resources) ); // expected: bool(true)
197 echo "\n*** Testing unset(), empty() & isset() with objects ***\n";
218 // use unset/empty/isset to check the object
223 var_dump( empty($point1) ); // expected: bool(false)
225 var_dump( empty($point1->$lable) ); //expected: bool(true)
230 var_dump( empty($point1->$lable) ); //expected: bool(false)
233 // because of the usage of the isset & empty
241 var_dump( empty($point1->x) ); // expected: bool(true)
249 var_dump( empty($point1) ); // expected: bool(false)
254 var_dump( empty($point1) ); // expected: bool(true)
258 // try isset/unset/empty on a member function
261 var_dump( empty($point2->testPoint) );
264 var_dump( empty($point2->testPoint) );
271 /* testing variation in operation for isset(), empty() & unset().
276 echo "\n*** Testing possible variation in operation for isset(), empty() & unset() ***\n";
289 // check using isset and empty
291 var_dump( empty($static_var) );
296 // check using isset and empty
298 var_dump( empty($static_var) );
319 // check using isset and empty to confirm
321 var_dump( empty($ref_val) );
344 // check the $global_var using isset and empty
346 var_dump( empty($global_var) );
351 // check the $global_var using isset and empty
353 var_dump( empty($global_var) );
365 *** Testing unset(), empty() & isset() with scalar variables ***
691 *** Testing unset(), empty() & isset() with arrays ***
1220 *** Testing unset(), empty() & isset() with objects ***
1289 *** Testing possible variation in operation for isset(), empty() & unset() ***