Download src/php/php-src/ext/gettext/tests/bug53251.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/gettext/tests/bug53251.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/gettext/tests/bug53251.phpt
-
curl -L -o bug53251.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/gettext/tests/bug53251.phpt
1.09 kB
| --TEST-- | |
| Bug #53251 (bindtextdomain with null dir doesn't return old value) | |
| --EXTENSIONS-- | |
| gettext | |
| --SKIPIF-- | |
| if (getenv('SKIP_REPEAT')) die('skip gettext leaks global state across requests'); | |
| --FILE-- | |
| $results[] = is_string(bindtextdomain('foo', null)); | |
| $dir = bindtextdomain('foo', '.'); | |
| $results[] = bindtextdomain('foo', null) === $dir; | |
| $results[] = bind_textdomain_codeset('foo', null); | |
| $results[] = bind_textdomain_codeset('foo', 'UTF-8'); | |
| $results[] = bind_textdomain_codeset('foo', null); | |
| $expected = [true, true, false, "UTF-8", "UTF-8"]; | |
| // musl's bindtextdomain() has no default directory to return when | |
| // "foo" is unbound, so in the first call, you will get false instead | |
| // of a string. | |
| // | |
| // bind_textdomain_codeset() always returns false on musl | |
| // because musl only supports UTF-8. For more information: | |
| // | |
| // * https://github.com/php/doc-en/issues/4311, | |
| // * https://github.com/php/php-src/issues/17163 | |
| // | |
| $expected_musl = [false, true, false, false, false]; | |
| var_dump($results === $expected || $results === $expected_musl); | |
| --EXPECT-- | |
| bool(true) | |