php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80130 Wrong result of pathinfo function with PATHINFO_FILENAME parameter
Submitted: 2020-09-21 18:47 UTC Modified: 2024-01-04 20:28 UTC
From: he dot expande at gmail dot com Assigned: bukka (profile)
Status: Closed Package: *Directory/Filesystem functions
PHP Version: 7.4.10 OS: Debian 10 (buster)
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: he dot expande at gmail dot com
New email:
PHP Version: OS:

 

 [2020-09-21 18:47 UTC] he dot expande at gmail dot com
Description:
------------
Information about the software on which the problem is observed:

> php -v
PHP 7.4.10 (cli) (built: Sep 10 2020 14:00:50) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.10, Copyright (c), by Zend Technologies
    with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans
> php test.php
/var/www/test.php:3:
string(36) " экрана 2020-09-21 в 13.05.29"



Information about the software on which the correct behavior:
>php -v
PHP 7.3.2 (cli) (built: Feb  5 2019 22:19:09) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.2, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.2, Copyright (c) 1999-2018, by Zend Technologies

> php test.php
string(48) "Снимок экрана 2020-09-21 в 13.05.29"







Test script:
---------------
<?php

var_dump(pathinfo('Снимок экрана 2020-09-21 в 13.05.29.png', PATHINFO_FILENAME));

Expected result:
----------------
string(48) "Снимок экрана 2020-09-21 в 13.05.29"


Actual result:
--------------
string(36) " экрана 2020-09-21 в 13.05.29"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-21 22:17 UTC] cmb@php.net
pathinfo() is locale aware[1][2], so please double-check whether
the two scripts run under the same locale.

Interestingly, with the "C" locale, only PHP 8.0 produces the
expected result[3].

[1] <https://www.php.net/pathinfo>
[2] <https://3v4l.org/51S9F>
[3] <https://3v4l.org/2r9F2>
 [2024-01-04 20:28 UTC] bukka@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: bukka
 [2024-01-04 20:28 UTC] bukka@php.net
PHP 8.2+ (versions with active support) produce expected result so nothing to do here. Probably got fixed as some part of other fix in 8.0.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 20:01:30 2025 UTC