1--TEST-- 2Test strripos() function : basic functionality - with default arguments 3--FILE-- 4<?php 5/* Prototype : int strripos ( string $haystack, string $needle [, int $offset] ); 6 * Description: Find position of last occurrence of a case-insensitive 'needle' in a 'haystack' 7 * Source code: ext/standard/string.c 8*/ 9 10echo "*** Testing strripos() function: basic functionality ***\n"; 11$heredoc_str = <<<EOD 12Hello, World 13EOD; 14 15echo "\n-- regular string for haystack & needle --\n"; 16var_dump( strripos("Hello, World", "HeLLo") ); 17var_dump( strripos('Hello, World', "hello") ); 18var_dump( strripos("Hello, World", 'WoRLd') ); 19var_dump( strripos('Hello, World', 'WORLD') ); 20var_dump( strripos('Hello, World', 'foo') ); 21 22echo "\n-- single char for needle --\n"; 23var_dump( strripos("Hello, World", "O") ); 24var_dump( strripos("Hello, World", ",") ); 25 26echo "\n-- heredoc string for haystack & needle --\n"; 27var_dump( strripos($heredoc_str, "Hello, WoRLd") ); 28var_dump( strripos($heredoc_str, 'HelLO') ); 29var_dump( strripos($heredoc_str, $heredoc_str) ); 30 31?> 32===DONE=== 33--EXPECT-- 34*** Testing strripos() function: basic functionality *** 35 36-- regular string for haystack & needle -- 37int(0) 38int(0) 39int(7) 40int(7) 41bool(false) 42 43-- single char for needle -- 44int(8) 45int(5) 46 47-- heredoc string for haystack & needle -- 48int(0) 49int(0) 50int(0) 51===DONE=== 52