by Eloy Lafuente (stronk7).
Hi Frank,
the memory_reset_peak_usage() function was introduced with PHP 8.2 (and Moodle 5.0.x requires PHP 8.2 and up too). And surely your web server is using a valid PHP version.
But tasks are not executed with that (web server) PHP version always, but with the default CLI (shell) one.
I'd suggest you to verify that the CLI PHP version (pathtophp admin configuration setting) is really >= 8.2 (8.3 an 8.4 also supported). Use that setting to point to a valid one, or update the one that is being used to a valid one.
Once you guarantee that the CLI PHP version is new enough, the task should stop reporting that error.
Ciao