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