Req #72007 [NEW]: java-like anonymous classes

From: Date: Mon, 11 Apr 2016 21:02:48 +0000
Subject: Req #72007 [NEW]: java-like anonymous classes
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200492@lists.php.net to get a copy of this message
From: matteo_tassinari_TM at libero dot it Operating system: Any PHP version: Next Minor Version Package: Class/Object related Bug Type: Feature/Change Request Bug description:java-like anonymous classes Description: ------------ I would like to suggest to implement anonymous class declaration as done in Java, while maintaining compatibility with current syntax. Currently, in order to extend a class or implement an interface, you would need to write: new class (construct params) extends Base implements Interface { ... } however, this could be simplified as new MyClass { .. } as equivalent to new class() extends MyClass { ... } or else new MyInterface { ... } as equivalent to new class() implements MyInterface { ... } This would also help better those with a Java background use them, even if it is just syntactinc sugar. -- Edit bug report at https://bugs.php.net/bug.php?id=72007&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72007&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72007&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72007&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=72007&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=72007&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=72007&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=72007&r=needscript Try newer version: https://bugs.php.net/fix.php?id=72007&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=72007&r=support Expected behavior: https://bugs.php.net/fix.php?id=72007&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=72007&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=72007&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=72007&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72007&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=72007&r=dst IIS Stability: https://bugs.php.net/fix.php?id=72007&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=72007&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=72007&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=72007&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=72007&r=mysqlcfg

« previous php.bugs (#200492) next »