I have a script which generates a CSV file with what might be a large dataset, so I increase the PHP max_execution_time.
Is there a way to reset max_execution_time to the system default either via a function or by reading the default first, increasing the value, then resetting to the default?
>Solution :
ini_restore('max_execution_time');
The documentation for that is here:
https://www.php.net/manual/en/function.ini-restore.php
If you want to get the original setting you can use ini_get('max_execution_time')
To echo that to the command line you could do the following:
echo 'Current value for \'max_execution_time\': ' . ini_get(max_execution_time), PHP_EOL;