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

Handling of "long" as a type #84

Open
tstumm opened this issue Jan 25, 2019 · 4 comments
Open

Handling of "long" as a type #84

tstumm opened this issue Jan 25, 2019 · 4 comments

Comments

@tstumm
Copy link

tstumm commented Jan 25, 2019

In AbstractConverter there is a mapping from long and unsignedLong to int.
Since PHPs int is signed (and there exists no unsigned) there may be overflow issues when using unsignedLong on a 32bit PHP interpreter. Even longs can be problematic, as those usually are defined to be at least 32 bits, but restrictions in the XSD may give min/max lengths that would overflow on 32bit types.

The long and unsignedLong mappings cannot be overridden, this would result in a strange mapping, i.e.
the default is long => int, so stating long => string besides that would yield sth. like int => string, which is unexpected behavior.

@goetas
Copy link
Member

goetas commented Jan 25, 2019

Arent nowadays most of the php installation 64 bits?

@tstumm
Copy link
Author

tstumm commented Jan 25, 2019

Depends, they should be BUT nevertheless, the mapping acts quite weird when trying to override it.
XAMPP installations on Windows provide 32bit interpreters. The main problem here is, that PHP automatically converts the int into a float if it overflows, which is known to be inaccurate (thanks IEEE).

@goetas
Copy link
Member

goetas commented Jan 25, 2019

Not sure if it makes sense to change it to strings... just for those who are still on 32 bit platforms...

@tstumm
Copy link
Author

tstumm commented Jan 25, 2019

I don't expect you to change it, but I think the software should behave differently when trying to override the defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants