Bug #80130 [Opn->Csd]: Wrong result of pathinfo function with PATHINFO_FILENAME parameter
| From: | bukka@php.net | Date: | Thu, 04 Jan 2024 20:28:05 +0000 |
| Subject: | Bug #80130 [Opn->Csd]: Wrong result of pathinfo function with PATHINFO_FILENAME parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-246175@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80130&edit=1
ID: 80130
Updated by: bukka@php.net
Reported by: he dot expande at gmail dot com
Summary: Wrong result of pathinfo function with
PATHINFO_FILENAME parameter
-Status: Open
+Status: Closed
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Debian 10 (buster)
PHP Version: 7.4.10
-Assigned To:
+Assigned To: bukka
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2020-09-21 22:17:37] 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>
------------------------------------------------------------------------
[2020-09-21 18:47:50] 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"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80130&edit=1