|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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: Tue Jun 18 12:01:29 2024 UTC