Req #72007 [Opn->Sus]: java-like anonymous classes

From: Date: Mon, 11 Apr 2016 21:55:41 +0000
Subject: Req #72007 [Opn->Sus]: java-like anonymous classes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200493@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72007&edit=1 ID: 72007 Updated by: requinix@php.net Reported by: matteo_tassinari_TM at libero dot it Summary: java-like anonymous classes -Status: Open +Status: Suspended Type: Feature/Change Request Package: Class/Object related Operating System: Any PHP Version: Next Minor Version Block user comment: N Private report: N New Comment: The current syntax for anonymous classes is the one supported. A change like this requires going through the RFC process. https://wiki.php.net/rfc/howto Previous Comments: ------------------------------------------------------------------------ [2016-04-11 21:02:46] matteo_tassinari_TM at libero dot it 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 this bug report at https://bugs.php.net/bug.php?id=72007&edit=1

« previous php.bugs (#200493) next »