php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #12819 variables and constants in classnames
Submitted: 2001-08-17 16:45 UTC Modified: 2003-05-31 10:46 UTC
From: giancarlo at navigare dot net Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.6 OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: giancarlo at navigare dot net
New email:
PHP Version: OS:

 

 [2001-08-17 16:45 UTC] giancarlo at navigare dot net
it would be nice to have the possibility to create classes with variable or constants in 'classname' and 'extends'.

eg:
define $myauth="myAuth";
define ("_BASE_AUTH_CLASS", "Base_Auth");

class {$myauth} extends {_BASE_AUTH_CLASS}
  {...
etc

This way package delivery and integration would be a lot easier, as they can presume the existance of already defined classes, and adopt them.


Giancarlo

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-31 10:46 UTC] andrey@php.net
Good architecting of the application and you will never run into such problems. Look into PEAR to see how they solved this or just prepend you class names with something specific to you (or your company).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 14 08:01:31 2024 UTC