Seems this would complicate the transplanting of (global) functions
into (default public) class methods and vice versa. This is a common
refactoring task -- at least IME -- and before I adjust visibility I
would expect the function to Just Work.

So this works in a class to define the function:

function my_function() { }

And I expect to be able to pull that out into the global scope as-is.

But if people start using this super-shorthand in the class:

my_function() { }

Then when I pull it out into my function library, I'll get errors.

The reverse is also true: I expect to get a fatal from leaving off a
semicolon between function_call() and {} but at the top level of a
class it gets smoothly compiled as a function definition.

Look, I know there are similar cases throughout PHP (and other
languages) already, but why add more for no (IMO) payoff? Perhaps not
the most compelling case against this new sugar, but it would suffice
to stop me from ever using it.

-- Sandy


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

Reply via email to