php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67593 Path in require or include that has C:\e...\script.php
Submitted: 2014-07-08 18:29 UTC Modified: 2014-07-08 20:15 UTC
From: abanarn at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: Irrelevant OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: abanarn at gmail dot com
New email:
PHP Version: OS:

 

 [2014-07-08 18:29 UTC] abanarn at gmail dot com
Description:
------------
Recently, I have been working on upgrading my php5.3 in my Windows servers. I have noticed that some of the includes are failing because the path name has \e for example : C:\epo\example.php and it thinks that "\e" is an escape code for ESC.

No issues in <= php-5.4.3

In php >= 5.4.4; I received the below:

<?php
require(C:\epo\example.php)
?>
Warning: require(C:←po\example.php): failed to open stream: In
valid argument in C:\php\db_connection.php on line 20

Fatal error: require(): Failed opening required 'C:←po\example.php'

Test script:
---------------
<?php
require(C:\epo\example.php)
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-08 18:32 UTC] abanarn at gmail dot com
-Summary: string escape code \e +Summary: Path in require or include that has C:\e...\script.php
 [2014-07-08 18:32 UTC] abanarn at gmail dot com
If directory name starts with letter 'e' include or require will complain
 [2014-07-08 20:15 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2014-07-08 20:15 UTC] requinix@php.net
Yup. \e was added in 5.4.0.

Moral of the story is to not use unescaped backslashes in double-quoted strings. Escape them, or use single-quoted strings, or use forward slashes because those work just fine even in Windows.
 [2014-07-08 23:03 UTC] abanarn at gmail dot com
I figured I will have to update the code to use what suggested. Thanks for confirming. Cheers
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 00:00:02 2026 UTC