--TEST-- Test strncasecmp() function : usage variations - unexpected values for 'len' --FILE-- 'red', 'item' => 'pen'), /* boolean values */ true, false, TRUE, FALSE, /* nulls */ NULL, null, /* empty string */ "", '', /* undefined variable */ @$undefined_var, /* unset variable */ @$unset_var, /* resource */ $file_handle, /* object */ new sample() ); /* loop through each element of the array and check the working of strncasecmp() */ $counter = 1; for($index = 0; $index < count($lengths); $index ++) { $len = $lengths[$index]; echo "-- Iteration $counter --\n"; var_dump( strncasecmp($str1, $str2, $len) ); $counter ++; } fclose($file_handle); echo "*** Done ***\n"; ?> --EXPECTF-- *** Test strncasecmp() function: unexpected values for 'len' *** -- Iteration 1 -- int(0) -- Iteration 2 -- int(0) -- Iteration 3 -- int(0) -- Iteration 4 -- int(0) -- Iteration 5 -- int(0) -- Iteration 6 -- int(0) -- Iteration 7 -- int(0) -- Iteration 8 -- Warning: strncasecmp() expects parameter 3 to be long, array given in %s on line %d NULL -- Iteration 9 -- Warning: strncasecmp() expects parameter 3 to be long, array given in %s on line %d NULL -- Iteration 10 -- Warning: strncasecmp() expects parameter 3 to be long, array given in %s on line %d NULL -- Iteration 11 -- Warning: strncasecmp() expects parameter 3 to be long, array given in %s on line %d NULL -- Iteration 12 -- Warning: strncasecmp() expects parameter 3 to be long, array given in %s on line %d NULL -- Iteration 13 -- int(0) -- Iteration 14 -- int(0) -- Iteration 15 -- int(0) -- Iteration 16 -- int(0) -- Iteration 17 -- int(0) -- Iteration 18 -- int(0) -- Iteration 19 -- Warning: strncasecmp() expects parameter 3 to be long, string given in %s on line %d NULL -- Iteration 20 -- Warning: strncasecmp() expects parameter 3 to be long, string given in %s on line %d NULL -- Iteration 21 -- int(0) -- Iteration 22 -- int(0) -- Iteration 23 -- Warning: strncasecmp() expects parameter 3 to be long, resource given in %s on line %d NULL -- Iteration 24 -- Warning: strncasecmp() expects parameter 3 to be long, object given in %s on line %d NULL *** Done ***