Hi! >> In short, while currently we have >> >> function byRef(&$ref) {...} >> byRef($var); >> >> this proposal would also allow >> >> function byRef(&$ref) {...} >> byRef(&$var);
I am not sure why it is necessary. If you call a function, one would assume you know what it is doing, at least you know its definition, and with any modern IDE if you do not, it is a matter of one click (or less) to reveal what the function does. So what is the point to mark it again? Does not seem to add anything that the writer or reader doesn't know or could easily find out. It could also imply that if the call site does not bear & mark, then the parameter can not be modified - which is not true (or only true for primitive values) and would add to the confusion. > I think it can either go forward as-is, in that it constitutes the first > step towards bringing sanity to by-reference passing in the long term. Or I Could you explain what you mean by "bringing sanity to by-reference passing"? Maybe if it would be clearer what you're getting at, in that context this proposal would be more understandable. > could first try to push through > https://wiki.php.net/rfc/namespace_scoped_declares or some variant thereof > so that call-site reference passing annotations can be made required on a > per-library/project basis. That certainly would be very annoying and I would be very much against it (and in general against the idea of fragmenting the language into a thousand of tiny pieces with different syntax by adding more and more local syntax-changing options) but I think this should be discussed separately so I'll say no more here. -- Stas Malyshev smalys...@gmail.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php