Re: [RFC] Anonymous Classes
| From: | Thomas Bley | Date: | Mon, 09 Mar 2015 01:47:54 +0000 |
| Subject: | Re: [RFC] Anonymous Classes | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-84450@lists.php.net to get a copy of this message | ||
Just a question, can I do:
$c = class {
public static function square($i) {
return $i*$i;
}
});
echo $c::square(42);
or
$c = class extends DateTime {
public static function createFromFormat($translateFormat, $time) {
$translateFormat = str_replace('foo', 'Y-m-d', $translateFormat);
return parent::createFromFormat($translateFormat, $time);
}
});
$date = $c::createFromFormat('foo', '2015-03-09');
Regards
Thomas
Philip Sturgeon wrote on 06.03.2015 20:14:
> Right, this here RFC has been drastically improved.
>
> https://wiki.php.net/rfc/anonymous_classes
>
> Anyone got any doubts or troubles at this point?
>
> It's about 5 days until the vote starts.
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>