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