> Do you think it is worth creating an RFC page about :: function ? I say that because I see that there are many voices against of :: function
Let us go back to the start of this thread. Your idea was to simplify
Then the discussion took the topic one level deeper. In your examples,
you seek a better way to pass a function as callable. In PHP a callable
1. a string
2. an array
3. a closure
Then it was suggested that a short syntax to wrap the function into a
closure is more useful. Using strings to refer to functions has
consistency issues and the proposed ::func does not solve them. Also,
the array syntax for referring to methods could use a better alternative.
All things considered, I think the originally proposed feature, using
::func to get the function name, has limited use.
Having a ::func (or ::function or ::fn) return a closure might be
somewhat controversial and there is no consensus about the name. The
only way to know how this will be received is to write an RFC and call
for a vote.
My own guess would be that an 'enclosure' construct along the lines of
has better chances of succeeding but you never know what happens.
Perhaps you could team up with MichaÅ and use the feedback from this
thread to produce an RFC.