Could it be safe to visualize that $_SERVER['REMOTE_ADDR'] always returns a IPv4 address?

Thanks!

The REMOTE_ADDR secret is set through the web server, not PHP. When the web server listens on v6 and also the user connects this way, it will be a v6 address