PHP 8.5.0 Beta 1 available for testing

Voting

: max(six, three)?
(Example: nine)

The Note You're Voting On

Anonymous
5 years ago
if you want to check how much time remains, this should work (at least on Windows, on non-Windows platforms, i'm not sure)

$seconds_remaining_until_termination = ini_get('max_execution_time') === "0" ? null : ((int)ini_get('max_execution_time'))-(microtime(true)-$_SERVER['REQUEST_TIME_FLOAT']);

gives you number of seconds until the script will be terminated due to the time limit. (tested on Windows 7 X64 SP1 with PHP 7.3.7) - or gives you null if there is no time limit.

<< Back to user notes page

To Top