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: 2020-09-21 22:17 UTC
From: he dot expande at gmail dot com Assigned:
Status: Open Package: *Directory/Filesystem functions
PHP Version: 7.4.10 OS: Debian 10 (buster)
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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>
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Oct 26 02:01:23 2020 UTC