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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
46 - 8 = ?
Subscribe to this entry?

 
 [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 18:01:32 2024 UTC