Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[php7] lowercase and uppercase same variable declaration #8219

Closed
filt3rek opened this issue Apr 26, 2019 · 9 comments
Closed

[php7] lowercase and uppercase same variable declaration #8219

filt3rek opened this issue Apr 26, 2019 · 9 comments
Assignees
Labels
platform-php Everything related to PHP

Comments

@filt3rek
Copy link
Contributor

Hej,

Haxe lets me declare 2 functions with the same name (one lowercase and second uppercase) but on runtime PHP complains.

@Aurel300 Aurel300 added the platform-php Everything related to PHP label Apr 26, 2019
@RealyUniqueName
Copy link
Member

I think Haxe should not allow that. @ncannasse ?

@nadako
Copy link
Member

nadako commented Apr 26, 2019

IMO, we could rename the locals, but for fields yeah, considering reflection and stuff it might be a reasonable target-specific limitation.

@RealyUniqueName
Copy link
Member

Why target specific? I think any sane code should not contain such field pairs.

@Gama11
Copy link
Member

Gama11 commented Apr 26, 2019

I'm not sure about that. I could see that happening especially with C# externs and native properties (convention is to capitalize the name) and regular fields.

@RealyUniqueName
Copy link
Member

RealyUniqueName commented Apr 26, 2019

But there is no such convention in Haxe. It could be allowed for externs only.

@ncannasse
Copy link
Member

ncannasse commented Apr 27, 2019 via email

@RealyUniqueName
Copy link
Member

Ok. I'll check if I can support such fields on the generator side before disallowing it completely.

@RealyUniqueName
Copy link
Member

I think I can support it in all cases except dynamic access, in which case it's most likely the first field in declaration order will be accessed.

@RealyUniqueName
Copy link
Member

After some trials I've decided to prohibit such fields pairs for PHP target. It turns out to be a lot of trouble for little gain.
This issue only affects methods. Variables and "var" class fields are case-sesnsitive in PHP runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-php Everything related to PHP
Projects
None yet
Development

No branches or pull requests

6 participants