> > > > “Should there be some way for developers to signal to the parser at > > compile time that all unqualified function names found in a > > namespace > > context are global, without a namespace lookup?” > > > > Yes: We should do this, let's discuss syntax possibilities. > > > > No: This should not be a feature at all. > > > > Thank you for your consideration. > > Hi Nick > > I'm not sure how I feel about adding an additional signaling / syntax > system > to signal the parser to change the behaviour of function lookup. > It means people have to take into account that a fundamental > behaviour can be changed. > PHP is already hard to use IMHO because of many things you have to > keep into the > back of your head, and adding something like this adds even more > complexity. > If we're going to make such a change I'd rather have it > unconfigurable. > > Kind regards > Niels
My thought was that it would have some clean and simple syntax, like: namespace foo using global functions; class MyClass{ } When the parser hits that token, it just sets a flag and acts like every unqualified classname has a backslash in front of it. For everyone else: namespace foo; class MyClass{ } ...would still work exactly the same as it does now. And would keep BC.