I noticed an error happening only with XAMPP.
I tried with 4 other live hosting accounts (including AWS, hostgator and 2 others), they all act the same upon numbers but not XAMPP. Here is what happens when running the same echo on real servers and XAMPP:
/* ALL SERVERS */
$testid = 5039307356925138;
echo (int)$testid;// 5039307356925138
echo $testid;// 5039307356925138
/* XAMPP (32bit) AT WINDOWS 10 64 bit LOCALHOST*/
$testid = 5039307356925138;
echo (int)$testid;// 753691858
echo $testid;// 5.03930735692514E+15
What does this mean and why!?
After working for hours in the issue, checking every forum post,
I increased precision in php.ini and restarted apache:
precision=20 (note that all live servers are only 12!)
Now it is:
/* XAMPP */
$testid = 5039307356925138;
echo (int)$testid;// 753691858
echo $testid;// 5039307356925138
As you may already guess it is still not a solution and scripts do not run properly because XAMPP treats 5039307356925138 as 753691858 ?!?
Furthermore, increasing precision too much caused problems like 3.250000000001% or something where other numbers are used.
I tried re-installing XAMPP with new version and tried this on another computer but all are the same.
I know my operating system is 64 bit and XAMPP is 32 bit (because XAMPP doesn't have 64 bit version for windows)
And I'm using SSL (https) on localhost so I need to use XAMPP.
if I use (float) instead of (int) it works but I need to increase precision as well.
Increasing precision breaks other side of the script and I'm sending the ID to API they validate the integer.
What might be the cause? how to fix it????