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

Deprecation: Implicit conversion from float to int loses precision #2940

Closed
wanted80 opened this issue Feb 7, 2024 · 1 comment · Fixed by #2972
Closed

Deprecation: Implicit conversion from float to int loses precision #2940

wanted80 opened this issue Feb 7, 2024 · 1 comment · Fixed by #2972
Labels

Comments

@wanted80
Copy link

wanted80 commented Feb 7, 2024

Hello,

I encountered an issue with the following code:

echo Carbon::parse('2024-02-06', 'Europe/Rome')->diffInDays(Carbon::parse('2023-09-27', 'Europe/Rome'));

Carbon version: 3.0.2

PHP version: 8.3.2

I expected to get:

-132.0

But I actually get:

-132.04166666667

My PHP default timezone is set to Europe/Rome. I tested it forcing UTC timezone and return 132.0.

Thanks!

@wanted80 wanted80 closed this as completed Feb 7, 2024
@wanted80
Copy link
Author

wanted80 commented Feb 7, 2024

Sorry, I closed because was my mistake and I solved it in my code.

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

Successfully merging a pull request may close this issue.

2 participants