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

32 bit PHP: Return value of Amp\Loop\NativeDriver::now() must be of the type int, float returned #413

Open
flaviobattimo opened this issue Jan 30, 2023 · 4 comments

Comments

@flaviobattimo
Copy link

flaviobattimo commented Jan 30, 2023

Got this error:

Return value of Amp\Loop\NativeDriver::now() must be of the type int, float returned

#0 vendor/amphp/amp/lib/Loop/NativeDriver.php(130): Amp\Loop\NativeDriver->now()
#1 vendor/amphp/amp/lib/Loop/Driver.php(138): Amp\Loop\NativeDriver->dispatch()
#2 vendor/amphp/amp/lib/Loop/Driver.php(72): Amp\Loop\Driver->tick()
#3 vendor/amphp/amp/lib/Loop.php(95): Amp\Loop\Driver->run()

version: v2.6.2

PHP 7.4.30 (cli) (built: Jul 7 2022 15:51:43) ( NTS )

Thanks,
Flavio

@trowski
Copy link
Member

trowski commented Feb 11, 2023

Are you running on a 32-bit install of PHP?

If so, I would have expected some warnings from

\trigger_error(
"getCurrentTime() will overflow in $timeToOverflow seconds, please restart the process before that. " .
"You're using a 32 bit version of PHP, so time will overflow about every 24 days. Regular restarts are required.",
\E_USER_WARNING
);

@flaviobattimo
Copy link
Author

Thanks, good to know.
Yes, it's a 32bit OS running on an RPI4. It's a long running process, I will restart it regularly.

@kelunik
Copy link
Member

kelunik commented Feb 13, 2023

@flaviobattimo I haven't been able to test this warning, as I don't have any 32 bit system available. Could you please check whether warnings are enabled in your error reporting settings and check the log? It'd be helpful to know the warning works as expected.

@flaviobattimo
Copy link
Author

I can't find any warning in the logs, but they might be disabled. Instead of a warning, a method to check when to restart the process could be useful. But I understand 32 bit systems are almost gone.

@kelunik kelunik changed the title Return value of Amp\Loop\NativeDriver::now() must be of the type int, float returned 32 bit PHP: Return value of Amp\Loop\NativeDriver::now() must be of the type int, float returned Aug 13, 2023
@amphp amphp deleted a comment from VictorGSoutoXP Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants