File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
ext/standard/tests/directory Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #74589 __DIR__ wrong for unicode character, UTF-8
3
+ --SKIPIF--
4
+ <?php
5
+ if (substr (PHP_OS , 0 , 3 ) != 'WIN ' || PHP_OS != 'Linux ' ) {
6
+ die ('skip Linux or Windows only ' );
7
+ }
8
+ ?>
9
+ --INI--
10
+ internal_encoding=utf-8
11
+ --FILE--
12
+ <?php
13
+ /*
14
+ #vim: set fileencoding=utf-8
15
+ #vim: set encoding=utf-8
16
+ */
17
+
18
+ $ item = "bug74589_新建文件夹 " ; // utf-8 string
19
+ $ dir = dirname (__FILE__ ) . DIRECTORY_SEPARATOR . $ item ;
20
+ $ test_file = $ dir . DIRECTORY_SEPARATOR . "test.php " ;
21
+
22
+ mkdir ($ dir );
23
+
24
+ file_put_contents ($ test_file ,
25
+ "<?php
26
+ var_dump(__DIR__);
27
+ var_dump(__FILE__);
28
+ var_dump(__DIR__ === dirname(__FILE__)); " );
29
+
30
+ $ php = getenv ('TEST_PHP_EXECUTABLE ' );
31
+
32
+ echo shell_exec ("$ php -n $ test_file " );
33
+
34
+ ?>
35
+ ===DONE===
36
+ --EXPECTF--
37
+ string(%d) "%sbug74589_新建文件夹"
38
+ string(%d) "%sbug74589_新建文件夹\test.php"
39
+ bool(true)
40
+ ===DONE===
41
+ --CLEAN--
42
+ <?php
43
+ $ item = "bug74589_新建文件夹 " ; // utf-8 string
44
+ $ dir = dirname (__FILE__ ) . DIRECTORY_SEPARATOR . $ item ;
45
+ $ test_file = $ dir . DIRECTORY_SEPARATOR . "test.php " ;
46
+ unlink ($ test_file );
47
+ rmdir ($ dir );
48
+ ?>
49
+
You can’t perform that action at this time.
0 commit comments