I'm a Pythonista who had to deal with a client's legacy PHP codebase earlier this year. One tactic I used was to try to write all new stuff, where I could, in Python. Tasks that could be separate processes from their existing PHP stuff. For example, command-line tools, automation, supplementary web apps, etc.