-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
What's wrong? #18
Comments
You are using PHP 5.3 which was released in 2009 and where support ended for in 2014. This package requires PHP >= 5.4 if you have a look at the composer.json file. Anyway, support for PHP 5.4 ended in 2015, and 5.5 was actually supported until yesterday, so I'd recommend you to upgrade to 5.6 if you can. |
Yes I noticed the sintaxe, because of that I have to change line 108. |
I'm not the author of this package, but as it requires PHP >= 5.4 you may experience unexpected behavior with a lower version. What you can do is to run the tests and check if they pass. |
Optimus only works if the id is less than max int. it is designed that way. If you want, you can fork the library and increase MAX_INT not 9223372036854775807. |
We could add a method to override the internal max integer value. |
@jenssegers @pjebs i did try to increase MAX_INT in Optimus.php but it doesn't work
Result:
|
are you sure |
@pjebs I'm very sure. I also checked over the source but no method to override default MAX_INT. I saw your comments on repo optimus-go, it seems very easy to change, but i have no idea why it doesn't work on my test. Thank you! v0.2.2
|
Try essentially creating your own Optimus class that is |
hi @pjebs i forked this repo, change MAX_INT,.. and made a test
It still doesn't work, can you please have a look and correct me if anything wrong. |
Can you try the example values in the ReadMe. See if you can recreate those results. |
I suspect |
it doesn't match I did try with
|
It seems the max number can only be 2147483647? even 64bit system with PHP 7.1 |
Installed optimus package and used the below code $optimus = new Optimus(158003, 59260, 1163); $value = "10000"; i am getting this error :: Call to undefined function Jenssegers\Optimus\gmp_intval() |
you prob need gmt php extension installed |
Hi.
Using the example numbers:
My IDs are MySQL's bigint that can be 20 digits long! Optimus is not for me?
What am I missing? There is a length limit?
php -v
PHP 5.3.2-1ubuntu4.30 with Suhosin-Patch (cli) (built: Apr 17 2015 15:01:29)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
uname -a
Linux picard 2.6.32-74-server #142-Ubuntu SMP Tue Apr 28 10:12:19 UTC 2015 x86_64 GNU/Linux
I had to change line 108 at src/Optimus.php to get it working:
to
Thanks in advance.
The text was updated successfully, but these errors were encountered: