1--TEST--
2Test chop() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : string chop ( string $str [, string $charlist] )
6 * Description: Strip whitespace (or other characters) from the end of a string
7 * Source code: ext/standard/string.c
8*/
9
10/*
11 * Testing chop(): basic functionality
12*/
13
14echo "*** Testing chop() : basic functionality ***\n";
15
16// Initialize all required variables
17$str = "hello world\t\n\r\0\x0B  ";
18$charlist = 'dl ';
19
20// Calling chop() with default arguments
21var_dump( chop($str) );
22
23// Calling chop() with all arguments
24var_dump( chop($str, $charlist) );
25
26// Calling chop() with the charlist not present at the end of input string
27var_dump( chop($str, '!') );
28
29echo "Done\n";
30?>
31--EXPECTF--
32*** Testing chop() : basic functionality ***
33string(11) "hello world"
34string(16) "hello world
35
35�"
36string(18) "hello world
37
37�  "
38Done
39