facebook / hhvm

A virtual machine for executing programs written in Hack.
https://hhvm.com
Other
18.21k stars 3k forks source link

Stop replacing dots with underscores #5916

Closed steelbrain closed 8 years ago

steelbrain commented 9 years ago

It is like that because register_globals wouldn't work with dots, but now that we all know the benefits of it ( :laughing: ) how about we have a ini setting that disables it? /cc @sgolemon @SiebelsTim @danslo

steelbrain commented 9 years ago

Ref: http://stackoverflow.com/questions/68651/get-php-to-stop-replacing-characters-in-get-or-post-arrays

derickr commented 9 years ago

IMO, this shouldn't change until PHP itself changes it.

steelbrain commented 9 years ago

@derickr Any good reason to be compatible with PHP here? I mean, I am talking about an ini setting which toggles it.

fredemmott commented 9 years ago

I dislike this: it's a subtle behavior change that can't be easily be picked up by an application unit test.

steelbrain commented 9 years ago

@fredemmott while I agree that one can easily understand with an application unit test what php is doing. But it also limits one's ability to distinguish between inputs. I mean a.b and a_b are treated as same. One can't have them both at the same.

derickr commented 9 years ago

Adding an ini settings encourages the writing of non-portable applications. If you have written it for HHVM with the ini setting set to On, then you can never run it on plain PHP again. ini settings in general make code less portable, as in many cases a developer might not have access to set it, and hence, developers of apps that need to deploy now need to account for the setting being on, or off. — and then only for HHVM.

steelbrain commented 9 years ago

@derickr I am not sure what you mean by portable here but I am pretty sure that PHP runtime can't run my hacklang application. I am just asking for a way to disable the madness php has introduced in the lang.

fredemmott commented 9 years ago

Having your application depend on ini settings is not good practice.

An alternative less likely to lead to problems would be to add a new API and discourage usage of the superglobals in Hack applications.

paulbiss commented 8 years ago

This feature request is not actively being worked on. We would happily consider a pull request implementing it. If you plan to work on this issue let us know in the comments and we will re-open the issue and assign it to you. If you feel strongly that this issue deserves more attention, please comment here with your use-case and we will try to prioritize as appropriate.