#43046 [Opn->Bgs]: Introduce constant NAMESPACE_SEPARATOR

From: Date: Sat, 20 Oct 2007 14:52:39 +0000
Subject: #43046 [Opn->Bgs]: Introduce constant NAMESPACE_SEPARATOR
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-118757@lists.php.net to get a copy of this message
ID: 43046 Updated by: johannes@php.net Reported By: lars at strojny dot net -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: Gentoo Linux PHP Version: 5.3CVS-2007-10-19 (snap) New Comment: The reason for DIRECTORY_SEPARATOR is that the value is platform dependent, the namespace separator isn't. Previous Comments: ------------------------------------------------------------------------ [2007-10-19 23:10:58] lars at strojny dot net Sorry, changed summary by accident ------------------------------------------------------------------------ [2007-10-19 22:40:13] lars at strojny dot net Could help to keep a codebase cleaner and better readable. Take a look at: $path = str_replace('::', DIRECTORY_SEPARATOR, $class_name); vs. $path = str_replace(NAMESPACE_SEPARATOR, DIRECTORY_SEPARATOR, $class_name); is - in my opinion - easier to understand and better to read. ------------------------------------------------------------------------ [2007-10-19 22:32:22] lars at strojny dot net Sorry, wrong version. ------------------------------------------------------------------------ [2007-10-19 22:30:18] derick@php.net Why is this useful? ------------------------------------------------------------------------ [2007-10-19 22:21:59] lars at strojny dot net Description: ------------ A constant for the namespace separator should be defined. I would propose to define NAMESPACE_SEPARATOR to "::", similiar to DIRECTORY_SEPARATOR. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43046&edit=1

« previous php.bugs (#118757) next »