|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74414 basename() random result with unicode filename
Submitted: 2017-04-11 12:40 UTC Modified: 2017-04-23 04:22 UTC
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: vasilii dot b dot shpilchin at gmail dot com Assigned:
Status: No Feedback Package: Unicode Engine related
PHP Version: 7.1.3 OS: CentOS 7.2 x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: vasilii dot b dot shpilchin at gmail dot com
New email:
PHP Version: OS:


 [2017-04-11 12:40 UTC] vasilii dot b dot shpilchin at gmail dot com
The function basename() are random split a filename by first ASCII char. I get unexcepted actual result in 1/3 cases with same filename.
I get actual result with mod_php, and never in CLI.

Test script:
echo basename('/имя.doc');

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-14 16:20 UTC]
-Status: Open +Status: Feedback
 [2017-04-14 16:20 UTC]
Thanks for the report. There should be no difference in SAPI, the function is same everywhere. Likely that the input encoding is different. If you use var_dump(), the length will likely reveal whether a single byte encoding is used.

 [2017-04-14 16:28 UTC]
Seems a single byte encoding issue. UTF-8 is fine.

 [2017-04-23 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 15:01:33 2024 UTC