I've been happily programming in Python for a long time (6+ years) and so far I've been fortunate to never have to write a single line of PHP. Recently I was contacted by BigNameCorp regarding a good job opportunity. Problem is, PHP is the main language (among several others) of said company and chances are that at least part of the job will be writing and reading PHP code. Although that's not necessarily a show stopper, I'm afraid I have been spoiled working with a high level language for so long and I'm not particularly thrilled to move down the language totem pole.
I've seen blog posts about moving away from PHP to Python, Ruby, and other better languages but not much about the opposite direction. Have you been in a similar situation and if so how did you manage to adapt and maintain your sanity ? Any suggestions, warnings or pointers on learning the good parts of PHP (if there are any) for advanced programmers would be most helpful.
If you do however see an old-style "let's just include everything", "global variables are cool", "just shove it into $_SESSION" kind of code... well - good luck, you'll need it ;)
There's also going to be some forehead slapping as you discover what is not possible (like `function_returning_array()[0]` => syntax error)
I get to write PHP once in a while but normally prefer Python. It's easy to spot in the style of the code written... but otherwise, no problems. I'd just suggest changing the error reporting level to maximum - it's not hard to write a lot of PHP code that will both work correctly and report tens of warnings per line.