1--TEST--
2Test stripslashes() function : error conditions
3--FILE--
4<?php
5/* Prototype  : string stripslashes ( string $str )
6 * Description: Returns an un-quoted string
7 * Source code: ext/standard/string.c
8*/
9
10/*
11 * Testing stripslashes() for error conditions
12*/
13
14echo "*** Testing stripslashes() : error conditions ***\n";
15
16// Zero argument
17echo "\n-- Testing stripslashes() function with Zero arguments --\n";
18var_dump( stripslashes() );
19
20// More than expected number of arguments
21echo "\n-- Testing stripslashes() function with more than expected no. of arguments --\n";
22$str = '\"hello\"\"world\"';
23$extra_arg = 10;
24
25var_dump( stripslashes($str, $extra_arg) );
26var_dump( $str );
27
28echo "Done\n";
29?>
30--EXPECTF--
31*** Testing stripslashes() : error conditions ***
32
33-- Testing stripslashes() function with Zero arguments --
34
35Warning: stripslashes() expects exactly 1 parameter, 0 given in %s on line %d
36NULL
37
38-- Testing stripslashes() function with more than expected no. of arguments --
39
40Warning: stripslashes() expects exactly 1 parameter, 2 given in %s on line %d
41NULL
42string(18) "\"hello\"\"world\""
43Done
44