Req #62257 [NEW]: Allow variables in class create

From: Date: Fri, 08 Jun 2012 01:08:33 +0000
Subject: Req #62257 [NEW]: Allow variables in class create
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-171123@lists.php.net to get a copy of this message
From:             valentiny510 at yahoo dot es
Operating system: XP
PHP version:      5.4.3
Package:          Class/Object related
Bug Type:         Feature/Change Request
Bug description:Allow variables in class create

Description:
------------
I think may be very useful sometimes allowing the use of variables when
create some class like this:

$class = 'test';
class $class { }

Sometimes when working with some cms/framework etc.. they have
a_very_very_very_long_name_for some_classes and will be more easy (depends
of situation) to have an array with shorten name. Ex:

$short_names = array (
    'short1' => 'a_very_long_name_of_some_class',
    'short2' => 'another_very_long_name');
foreach ($short_names as $short => $long)
    class $short extends $long { }
/*endforeach*/;



-- 
Edit bug report at https://bugs.php.net/bug.php?id=62257&edit=1
-- 
Try a snapshot (PHP 5.4):            https://bugs.php.net/fix.php?id=62257&r=trysnapshot54
Try a snapshot (PHP 5.3):            https://bugs.php.net/fix.php?id=62257&r=trysnapshot53
Try a snapshot (trunk):              https://bugs.php.net/fix.php?id=62257&r=trysnapshottrunk
Fixed in SVN:                        https://bugs.php.net/fix.php?id=62257&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62257&r=needdocs
Fixed in release:                    https://bugs.php.net/fix.php?id=62257&r=alreadyfixed
Need backtrace:                      https://bugs.php.net/fix.php?id=62257&r=needtrace
Need Reproduce Script:               https://bugs.php.net/fix.php?id=62257&r=needscript
Try newer version:                   https://bugs.php.net/fix.php?id=62257&r=oldversion
Not developer issue:                 https://bugs.php.net/fix.php?id=62257&r=support
Expected behavior:                   https://bugs.php.net/fix.php?id=62257&r=notwrong
Not enough info:                     https://bugs.php.net/fix.php?id=62257&r=notenoughinfo
Submitted twice:                     https://bugs.php.net/fix.php?id=62257&r=submittedtwice
register_globals:                    https://bugs.php.net/fix.php?id=62257&r=globals
PHP 4 support discontinued:          https://bugs.php.net/fix.php?id=62257&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=62257&r=dst
IIS Stability:                       https://bugs.php.net/fix.php?id=62257&r=isapi
Install GNU Sed:                     https://bugs.php.net/fix.php?id=62257&r=gnused
Floating point limitations:          https://bugs.php.net/fix.php?id=62257&r=float
No Zend Extensions:                  https://bugs.php.net/fix.php?id=62257&r=nozend
MySQL Configuration Error:           https://bugs.php.net/fix.php?id=62257&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#171123) next »