On 19/09/12 18:16, Levi Morrison wrote:
On Tue, Sep 18, 2012 at 8:48 PM, Steve Clay <st...@mrclay.org> wrote:
Hello,
https://wiki.php.net/rfc/alternative_callback_syntax is a proposal for a simple
alternative syntax for creating function callbacks.
The basics: Given a function/method call, replace the argument list with
"::function". PHP would evaluate this as a callback for the function/method,
fully resolving any class/function names according to the current namespace and any use
statements.
In my opinion this syntax would aid readability and benefit users via fewer
typos and namespace errors, and via (hopefully) better IDE support.
I welcome any feedback. I don't have adequate C skills to offer a patch at the
moment, but I generally read everything I can get my hands on about how PHP
features are implemented and am not afraid to jump in.
Thanks for your time.
P.S. I've kicked around this idea around for awhile, but Ralph Schindler's idea
for using ::keyword provided a better path to BC, and more
attractive/meaningful syntax.
P.P.S. I'm unaware if it's customary to throttle the release of RFCs, so I
apologize for hogging any attention away from those under discussion.
Steve Clay
--
http://www.mrclay.org/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
I do not like this proposal. The syntax is ugly and not intuitive.
We need a different way to accomplish this.
I completely agree. How about &function_name? Resembles C (function
pointers!), and unless I'm getting confused, it isn't currently legal
syntax for something else.
--
Andrew Faulds
http://ajf.me/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php