1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 09:12:14 +01:00
Files
archived-php-src/ext/standard/tests/strings/trim_error.phpt
2020-06-24 13:13:44 +02:00

36 lines
892 B
PHP

--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
"