Did you ever figure out this issue. I'm having the same problem as soon as I upgrade PHP to v7.3 or higher. v7.2 works without issues.
My thread... https://moodle.org/mod/forum/discuss.php?d=423763#p1707452
My thread... https://moodle.org/mod/forum/discuss.php?d=423763#p1707452