Bug #79739 [NEW]: inconsistent __DIR__ with accent
From: lingtalfi at gmail dot com
Operating system: mac osX mojave 10.14.6
PHP version: 7.2.31
Package: Apache2 related
Bug Type: Bug
Bug description:inconsistent __DIR__ with accent
Description:
------------
I create two files in my webroot directory www (served by apache
2.4.37):
- a.php
- b.php
In both I add this script:
```php
var_dump(__DIR__); exit;
```
The output from **a.php** is different than the one from **b.php** !!!
The output from a is this:
```html
string(88) "/Users/xxxxxxxxxxxxx/Documents/it/web/Komin>/service
création/projets/jin_site_demo/www"
```
While the output from b is this:
```html
string(89) "/Users/pierrelafitte/Documents/it/web/Komin>/service
creÌation/projets/jin_site_demo/www"
```
I'm not sure where the problem comes from (php?, apache?, my mac?),
but there is obviously a problem as they should output the exact same
string.
The problem comes from the accent (é) which is not encoded in the same
manner,
I tried using the php binary (php -f a.php), and both scripts output
identical output, which means that the problem only occur when using php
with apache.
I'm just a php user (not php developer) so I don't have any patch, but
hopefully, if it's a php problem, this post helps to fix it.
Test script:
---------------
var_dump(__DIR__); exit;
--
Edit bug report at https://bugs.php.net/bug.php?id=79739&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79739&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79739&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79739&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79739&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79739&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79739&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79739&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79739&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79739&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79739&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79739&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79739&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79739&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79739&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79739&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79739&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79739&r=mysqlcfg
Thread (4 messages)
- lingtalfi at gmail dot com