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

Remove PHP_INT_MAX constant #271

Closed
oqq opened this issue Mar 9, 2017 · 2 comments · Fixed by prooph/pdo-event-store#65
Closed

Remove PHP_INT_MAX constant #271

oqq opened this issue Mar 9, 2017 · 2 comments · Fixed by prooph/pdo-event-store#65

Comments

@oqq
Copy link
Member

oqq commented Mar 9, 2017

I would prefer to using null instead of PHP_INT_MAX in load methods and let decide the implementation how to handle this value. In most cases this value could be ignored in query if it is null, if it is not necessary for index usage. Also, PHP_INT_MAX has a higher memory footprint than null. Even it is not always true that PHP and the underlying storage uses the same cpu architecture. (32bit vs. 64bit)

I have not investigate much in that issue. Maybe there is a good reason for PHP_INT_MAX instead of null. But if not, please let us remove that constant. I always feel bad if I have to use this constant with event_store.

@prolic
Copy link
Member

prolic commented Mar 10, 2017

What about loadReverse then?

@oqq
Copy link
Member Author

oqq commented Mar 10, 2017

The EventStore implementation has to know how to handle null. e.g the PdoEventStore removes the nofrom the where clause OR implement PHP_INT_MAX again. Its up the the event store implementation.

With PHP_INT_MAX I am not able to get if a user says "no limit" or "a big number to start".

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

Successfully merging a pull request may close this issue.

2 participants