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