A solution for WAMPServer 3.3.8 is: don't just upgrade the PHP to 8.x, also upgrade its apache to the latest, e.g. "wampserver3_x64_addon_apache2.4.63.1.exe", and the issue is gone for me.
Background: I encountered same error as the OP. I am using WAMPServer 3.3.8, upgraded from WAMPServer 3.2.3 (with PHP 7.2.x, Apache 2.4.46). The error (`Undefined function curl_init()`) occurs when using curl_init() after installed addon "wampserver3_x64_addon_php8.4.7.exe", and using its PHP 8.4. The extension has been enabled by `extension=curl`. After that, upgrading also the apache to latest solved for me.
Somewhat similar to the answer of "Alex Fritz", but give explicit example.