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

Exception with "Endian::LITTLE_ENDIAN_LOW_WORD_FIRST" #89

Closed
gutschein opened this issue May 26, 2021 · 2 comments
Closed

Exception with "Endian::LITTLE_ENDIAN_LOW_WORD_FIRST" #89

gutschein opened this issue May 26, 2021 · 2 comments

Comments

@gutschein
Copy link

Hi Martti,

Endian::$defaultEndian = Endian::LITTLE_ENDIAN_LOW_WORD_FIRST;

I get an exception "Undefined class constant 'LITTLE_ENDIAN_LOW_WORD_FIRST'" Do I have a typo or a missunderstanding about the 4th possible endian option? The other 3 work as expected.

@aldas
Copy link
Owner

aldas commented May 27, 2021

Endian is actually bitmask that consist of byte order (LE or BE) and word order (low word first or "high word first")

See this:

const BIG_ENDIAN_LOW_WORD_FIRST = self::BIG_ENDIAN | self::LOW_WORD_FIRST;

If you want to set LE+LWF use:

Endian::$defaultEndian = Endian::LITTLE_ENDIAN | Endian::LOW_WORD_FIRST;

@gutschein
Copy link
Author

Usage wasn't clear for me in the help; i assumed that it wold work as for BIG_ENDIAN.

But with your hint: Works now as expetced! :) Thank you.

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