Req #62257 [Fbk->NoF]: Allow variables in class create

From: Date: Sun, 18 Jan 2015 04:22:27 +0000
Subject: Req #62257 [Fbk->NoF]: Allow variables in class create
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190023@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62257&edit=1 ID: 62257 Updated by: php-bugs@lists.php.net Reported by: valentiny510 at yahoo dot es Summary: Allow variables in class create -Status: Feedback +Status: No Feedback Type: Feature/Change Request Package: Class/Object related Operating System: XP PHP Version: 5.4.3 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2015-01-08 00:43:36] danack@php.net Hi, it's not clear what you're asking for. The feature request in the original question doesn't appear to be the same as the feature request in the comment. Please can you clarify either here, or even better on the PHP internals email list where an RFC could be opened. ------------------------------------------------------------------------ [2012-10-26 19:41:42] dagguh at gmail dot com Absolutely disagreed. Downvoting this abomination. Leave creating anonymous classes to mock frameworks ------------------------------------------------------------------------ [2012-06-13 19:47:54] valentiny510 at yahoo dot es With the short names was just an example. Imagine one autoload function where you can create classes on the fly: (pseudofunction) function autoload( $class ) { if ( isset (array($class))) include/require $class elseif (file_exists($class)) include $class else class $class { function __get( $what ){ return $what 'to be / not to be' } } } and I can put here more than 10-20 quick examples... ------------------------------------------------------------------------ [2012-06-08 23:37:27] nikic@php.net If you want to shorten long names make use of the namespacing support introduced in 5.3. Simply write use SomeVery\VeryLong\NameAndMore as ShortName; and you're done. You can also do this programmatically using class_alias(). ------------------------------------------------------------------------ [2012-06-08 01:20:34] valentiny510 at yahoo dot es P.S. Not only for long names.. but also for autoloading/extending multiple classes.. now I let you to imaginate.. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=62257 -- Edit this bug report at https://bugs.php.net/bug.php?id=62257&edit=1

« previous php.bugs (#190023) next »