diff options
author | Lars Strojny <lstrojny@php.net> | 2012-02-01 14:43:52 +0000 |
---|---|---|
committer | Lars Strojny <lstrojny@php.net> | 2012-02-01 14:43:52 +0000 |
commit | 33a2c339bd509b80a22796acdee98fe06f06fe2d (patch) | |
tree | e9241be1a4e4be48d7c27bb56d1e68d45a5bfaf5 | |
parent | 586c834a363c144b9ca04faba67be01ee713bf89 (diff) | |
download | php-git-33a2c339bd509b80a22796acdee98fe06f06fe2d.tar.gz |
Test for null behavior with ext/mbstring functions
-rw-r--r-- | ext/mbstring/tests/mb_str_functions_opt-parameter.phpt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt new file mode 100644 index 0000000000..e4a235df30 --- /dev/null +++ b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt @@ -0,0 +1,32 @@ +--TEST-- +Optional long parameter might be null +--FILE-- +<?php +echo mb_strpos('abb', 'b', null, 'UTF-8') . "\n"; +echo mb_strrpos('abb', 'b', null, 'UTF-8') . "\n"; +echo mb_stripos('abb', 'B', null, 'UTF-8') . "\n"; +echo mb_strripos('abb', 'B', null, 'UTF-8') . "\n"; +echo mb_strstr('foobarbaz', 'ba', null, 'UTF-8') . "\n"; +echo mb_strrchr('foobarbaz', 'ba', null, 'UTF-8') . "\n"; +echo mb_stristr('foobarbaz', 'BA', null, 'UTF-8') . "\n"; +echo mb_strrichr('foobarbaz', 'BA', null, 'UTF-8') . "\n"; +echo mb_substr('foobarbaz', 6, null, 'UTF-8') . "\n"; +echo mb_strcut('foobarbaz', 6, null, 'UTF-8') . "\n"; +echo mb_strimwidth('foobar', 0, 3, null, 'UTF-8') . "\n"; +?> +==DONE== +--EXPECT-- +1 +2 +1 +2 +barbaz +baz +barbaz +baz +baz +baz +foo +==DONE== +--XFAIL-- +mb functions fail to allow null instead of actual value |