1--TEST--
2Test rtrim() function : error conditions
3--FILE--
4<?php
5
6echo "*** Testing rtrim() : error conditions ***\n";
7
8$hello = "  Hello World\n";
9echo "\n-- Test rtrim function with various invalid charlists\n";
10var_dump(rtrim($hello, "..a"));
11var_dump(rtrim($hello, "a.."));
12var_dump(rtrim($hello, "z..a"));
13var_dump(rtrim($hello, "a..b..c"));
14
15?>
16--EXPECTF--
17*** Testing rtrim() : error conditions ***
18
19-- Test rtrim function with various invalid charlists
20
21Warning: rtrim(): Invalid '..'-range, no character to the left of '..' in %s on line %d
22string(14) "  Hello World
23"
24
25Warning: rtrim(): Invalid '..'-range, no character to the right of '..' in %s on line %d
26string(14) "  Hello World
27"
28
29Warning: rtrim(): Invalid '..'-range, '..'-range needs to be incrementing in %s on line %d
30string(14) "  Hello World
31"
32
33Warning: rtrim(): Invalid '..'-range in %s on line %d
34string(14) "  Hello World
35"
36