From:             matutetandil at gmail dot com
Operating system: Any
PHP version:      Irrelevant
Package:          Class/Object related
Bug Type:         Feature/Change Request
Bug description:Add Generics support

Description:
------------
Add generics support to PHP. So you can declare classes like this:

class MyGenericClass<T> {
   private $object;

   public function __construct() {
       $this->object = new T();
   }
}

or

class MyGenericClass<T extends SuperTClass> {
   private $object;

   public function __construct() {
       $this->object = new T();
   }
}

In the first case you can make a new (supposing that there is defined a B 
class):
$a = new MyGenericClass<B>();

and in the second example you are forcing B to be a SuperTClass.

I hope you can implement this feature! Is great!!!

Expected result:
----------------
Generics included in a PHP relase.

Actual result:
--------------
No Generics support.

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

Reply via email to