Return to stripcslashes_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / strings |
1.1 misho 1: --TEST-- 2: Test stripcslashes() function : error conditions 3: --FILE-- 4: <?php 5: 6: /* Prototype : string stripcslashes ( string $str ) 7: * Description: Returns a string with backslashes stripped off. Recognizes C-like \n, \r ..., 8: * octal and hexadecimal representation. 9: * Source code: ext/standard/string.c 10: */ 11: 12: echo "*** Testing stripcslashes() : unexpected number of arguments ***"; 13: 14: 15: echo "\n-- Testing stripcslashes() function with no arguments --\n"; 16: var_dump( stripcslashes() ); 17: 18: echo "\n-- Testing stripcslashes() function with more than expected no. of arguments --\n"; 19: $extra_arg = 10; 20: var_dump( stripcslashes("abc def", $extra_arg) ); 21: ?> 22: ===DONE=== 23: --EXPECTF-- 24: *** Testing stripcslashes() : unexpected number of arguments *** 25: -- Testing stripcslashes() function with no arguments -- 26: 27: Warning: stripcslashes() expects exactly 1 parameter, 0 given in %s on line %d 28: NULL 29: 30: -- Testing stripcslashes() function with more than expected no. of arguments -- 31: 32: Warning: stripcslashes() expects exactly 1 parameter, 2 given in %s on line %d 33: NULL 34: ===DONE===