-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Invalid timestamp value passed to DateTimeResult::fromTimestamp on PHP 8.1 #2327
Comments
Unfortunately #2316 didn't fix the timestamp issue. I'm at a loss at what's causing this and would appreciate any help with figuring this out... https://github.com/laravel/framework/pull/39034/checks?check_run_id=3846321821#step:8:127 |
This is a complete stab in the dark but is this related: #2053 (comment) |
Hi @driesvints Looks the SDK is internally passing a float unix timestamp into aws-sdk-php/src/Api/DateTimeResult.php Line 26 in 79a1020
|
Same finding: I'm testing on PHP 8.1.0RC4-dev I even tried comparing using Laravel 8.x with PHP8.0 and Laravel php8.1-fixes with PHP 8.1.0RC4-dev By comparing PHP8.0 running gmdate, it has no problem running with float timestamp But PHP 8.1.0RC4-dev gmdate refuse to accept float due to the precision loss. One way is as suggested by @27pchrisl, otherwise might need to look for other date function that didn't loss that precision if that function exists? |
This is the signature of
It should be an integer anyway. |
@JackEllis @stephenkhoo @27pchrisl @clemblanco wow thanks a lot for your help here! And for figuring that out! I agree, the PR from @27pchrisl looks good. Let's get that in! 💪 |
|
Describe the bug
When I run the Laravel framework test suite on the upcoming PHP 8.1 release (now in release candidate), related tests to DynamoDB fail from an invalid timestamp issue. These tests are running fine on PHP 7.3 til PHP 8.0. This failure is specifically related to the DateTimeResult class but can origin further up the stacktrace.
https://github.com/laravel/framework/runs/3599702797#step:8:165
Stacktrace
Version of AWS SDK for PHP?
v3.193.3
Version of PHP (
php -v
)?PHP 8.1.0RC2-dev
To Reproduce (observed behavior)
The related test that fails is https://github.com/laravel/framework/blob/8.x/tests/Integration/Cache/DynamoDbStoreTest.php#L49-L55. There's three more but they're all triggering the same issue.
The tests basically translates to the following:
Expected behavior
I'd expect the behavior to be exactly the same in PHP 8.1
The text was updated successfully, but these errors were encountered: