> -----Original Message----- > From: Stas Malyshev [mailto:smalys...@sugarcrm.com] > Sent: 20 August 2012 00:08 > To: Derick Rethans > Cc: Nikita Popov; PHP internals > Subject: Re: [PHP-DEV] [RFC] Generators > > Hi! > > > I am against this. This is even more magic in PHP. Is it > really that > > difficult to have to mark the function with a different > keyword, such > > as > > "generator": > > You have a point here, but "public static final generator > function foo()" sounds a bit long-winded to me... Also, we'd > have then to decide which function can be marked generator > and which can't (e.g., interface probably can't, abstract > probably can't, anonymous probably can, etc.) which adds more > complexity.
That'd be return type hinting would it not? Given that generator functions currently return an instance of class Generator. Also anonymous generators would be quite strange $f = Generator function() { yield 'a'; }; Jared -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php