Req #61298 [Com]: Add an short alias DS for DIRECTORY_SEPARATOR
| From: | hanskrentel at yahoo dot de | Date: | Mon, 09 Jun 2014 14:22:37 +0000 |
| Subject: | Req #61298 [Com]: Add an short alias DS for DIRECTORY_SEPARATOR | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186116@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61298&edit=1
ID: 61298
Comment by: hanskrentel at yahoo dot de
Reported by: cornelius dot howl at gmail dot com
Summary: Add an short alias DS for DIRECTORY_SEPARATOR
Status: Not a bug
Type: Feature/Change Request
Package: *Directory/Filesystem functions
PHP Version: 5.4.0
Block user comment: N
Private report: N
New Comment:
Also nobody needs this constant. You can just use '/' (slash), it works.
Previous Comments:
------------------------------------------------------------------------
[2012-03-06 10:36:07] johannes@php.net
Constants should have clear names to help readability. If you want something shorter you can easily
do
const DS = DIRECTORY_SEPARATOR;
or using define(). If you have issue typing names correctly you can also get an IDE.
------------------------------------------------------------------------
[2012-03-06 06:39:18] cornelius dot howl at gmail dot com
Description:
------------
Really hope there is a DS alias for DIRECTORY_SEPARATOR, and PATH_SEPARATOR.
because it's too easy to make a typo, these keywords are hard to type.
$path = 'root' . DS . 'to' . 'path' . DS . 'subpath' . DS .
'subpath' . DS .
'file.txt';
rather than:
$path = 'root' . DIRECTORY_SEPARATOR . 'to' . 'path' .
DIRECTORY_SEPARATOR .
'subpath' . DIRECTORY_SEPARATOR . 'subpath' . DIRECTORY_SEPARATOR .
'file.txt';
the later is uglier.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61298&edit=1