Edit report at http://bugs.php.net/bug.php?id=41856&edit=1
ID: 41856
Comment by: jevon at jevon dot org
Reported by: mbaynton at gmail dot com
Summary: support for anonymous classes
Status: Open
Type: Feature/Change Request
Package: Feature/Change Request
PHP Version: 5.2.3
New Comment:
Another request for anonymous classes. Without support for anonymous
classes, it can sometimes be necessary to create hundreds of named, and
rarely used, classes. Anonymous classes are often used for quick
instances that are created and destroyed quickly, so a performance hit
is reasonable.
Previous Comments:
------------------------------------------------------------------------
[2008-11-11 06:24:37] igorsf at yahoo dot com
+1
------------------------------------------------------------------------
[2007-06-29 19:12:50] mbaynton at gmail dot com
Description:
------------
Just voicing my opinion that it would be nice to be able to create
anonymous inner classes as in Java.
Or put another way, I wish something like the reproduce code would work.
This looks much better than creating and naming a global class that has
some trivial purpose, like the one in the example.
Reproduce code:
---------------
if(! is_object($this->movie))
{
$this->movie = new __Object()
{
public function __call($name, $args)
{
return false;
}
};
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=41856&edit=1