<?php
interface IFoo {
public function method() : int;
}
$cb1 = function () implements IFoo : int {
return 42;
};
$cb2 = new class implements IFoo {
function method() : int {
return 42;
}
};
?>
Are $cb1 and $cb2 going to be the same (do the same)?
Is this just a new syntax sugar, or a really new feature?
According to implementation, I think, you shouldn't extend "zend_closure" with
"interface".
If this is a sugar, lets implement it as a sugar (without VM changes).
But may be I didn't understand the idea at all :)
Thanks. Dmitry.
________________________________________
From: Joe Watkins <[email protected]>
Sent: Monday, April 18, 2016 13:22
To: PHP internals
Subject: [PHP-DEV] RFC: Functional Interfaces
Morning Internals,
Please review the following RFC:
https://wiki.php.net/rfc/functional-interfaces
An implementation is provided, and is testable on 3v4l.
Review of the implementation from those of you that do that would be
good :)
Cheers
Joe
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php