php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7161 __FILE__ now generates \ instead of /
Submitted: 2000-10-12 11:30 UTC Modified: 2000-11-01 02:03 UTC
From: danielc at analysisandsolutions dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.3 OS: NT 4.0 SP 6a
Private report: No CVE-ID: None
 [2000-10-12 11:30 UTC] danielc at analysisandsolutions dot com
PHP has changed the way it displays directory separators in a file's path when calling the __FILE__ constant.  

PHP 3.0.11: g:\webroot/ideasphp/bug403-filepath.htm 
PHP 4.0.3:  g:\webroot\ideasphp\bug403-filepath.html

This inconsistency is causing problems my scripts which do an explode("/", __FILE__).

Guess I'll now have to swich to split("[\/]", __FILE__); for now.  But doing so changes the first array element from "g:\webroot" to "g:", which requires further code rewrites.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-01 02:03 UTC] andi@php.net
PHP 4 in thread safe environments such as NT (for now) makes sure that file names are created the standard way on our platform. In the case of NT, c:\foo\bar is the standard way. Sorry but you'll need to fix your scripts and best is if your solution works for both / and \ because they are both valid separators under NT.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 23:01:29 2024 UTC