xref: /PHP-8.4/ext/gettext/tests/bug53251.phpt (revision 74859783)
1--TEST--
2Bug #53251 (bindtextdomain with null dir doesn't return old value)
3--EXTENSIONS--
4gettext
5--SKIPIF--
6<?php
7if (getenv('SKIP_REPEAT')) die('skip gettext leaks global state across requests');
8?>
9--FILE--
10<?php
11var_dump(is_string(bindtextdomain('foo', null)));
12$dir = bindtextdomain('foo', '.');
13var_dump(bindtextdomain('foo', null) === $dir);
14
15var_dump(bind_textdomain_codeset('foo', null));
16var_dump(bind_textdomain_codeset('foo', 'UTF-8'));
17var_dump(bind_textdomain_codeset('foo', null));
18
19?>
20--EXPECT--
21bool(true)
22bool(true)
23bool(false)
24string(5) "UTF-8"
25string(5) "UTF-8"
26