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
> 


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to