Delete the file instantly!
This PHP
code is a modified webshell. Those could be used to atack other websites and could lead to serious legal problems!
After deletion you should also fix the leak that let the file in!
solved WordPress Site hacked? Suspicious PHP file