chop_basic.phpt 675 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Test chop() function : basic functionality
  3. --FILE--
  4. <?php
  5. /*
  6. * Testing chop(): basic functionality
  7. */
  8. echo "*** Testing chop() : basic functionality ***\n";
  9. // Initialize all required variables
  10. $str = "hello world\t\n\r\0\x0B ";
  11. $charlist = 'dl ';
  12. // Calling chop() with default arguments
  13. var_dump( chop($str) );
  14. // Calling chop() with all arguments
  15. var_dump( chop($str, $charlist) );
  16. // Calling chop() with the charlist not present at the end of input string
  17. var_dump( chop($str, '!') );
  18. echo "Done\n";
  19. ?>
  20. --EXPECTF--
  21. *** Testing chop() : basic functionality ***
  22. string(11) "hello world"
  23. string(16) "hello world
  24. %0 "
  25. string(18) "hello world
  26. %0 "
  27. Done