Upgraded server now class My_Walker_Nav_Menu extends Walker_Nav_Menu not working

In short, (and as I said in the comments) in your function declaration, the $depth parameter should be defined as $depth = 0. And that’s because the original function (or class method) made it optional by setting a default value, so you should also do the same:

function start_lvl( &$output, $depth = 0, $args = array() )

And if you wonder why so or why the warning was thrown by PHP, then check the PHP manual about “Signature compatibility rules” which says:

When overriding a method, its signature must be compatible with the
parent method. Otherwise, a fatal error is emitted, or, prior to PHP
8.0.0, an E_WARNING level error is generated. A signature is compatible if it respects the
variance
rules, makes a mandatory parameter optional, and if any new parameters
are optional. This is known as the Liskov Substitution Principle, or
LSP for short. The
constructor,
and private methods are exempt from these signature compatibility
rules, and thus won’t emit a fatal error in case of a signature
mismatch.

And on that page, there are actually examples demonstrating that a child method which removes a parameter, or makes an optional parameter mandatory, is not compatible with the parent method.

So I hope that helps. 🙂