mb_str_functions_opt-parameter.phpt 826 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Optional long parameter might be null
  3. --SKIPIF--
  4. <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
  5. --FILE--
  6. <?php
  7. echo mb_strpos('abb', 'b', null, 'UTF-8') . "\n";
  8. echo mb_strrpos('abb', 'b', null, 'UTF-8') . "\n";
  9. echo mb_stripos('abb', 'B', null, 'UTF-8') . "\n";
  10. echo mb_strripos('abb', 'B', null, 'UTF-8') . "\n";
  11. echo mb_strstr('foobarbaz', 'ba', null, 'UTF-8') . "\n";
  12. echo mb_strrchr('foobarbaz', 'ba', null, 'UTF-8') . "\n";
  13. echo mb_stristr('foobarbaz', 'BA', null, 'UTF-8') . "\n";
  14. echo mb_strrichr('foobarbaz', 'BA', null, 'UTF-8') . "\n";
  15. echo mb_substr('foobarbaz', 6, null, 'UTF-8') . "\n";
  16. echo mb_strcut('foobarbaz', 6, null, 'UTF-8') . "\n";
  17. echo mb_strimwidth('foobar', 0, 3, null, 'UTF-8') . "\n";
  18. ?>
  19. ==DONE==
  20. --EXPECT--
  21. 1
  22. 2
  23. 1
  24. 2
  25. barbaz
  26. baz
  27. barbaz
  28. baz
  29. baz
  30. baz
  31. foo
  32. ==DONE==