I have been coding primarily in Java my entire career (~4 years). Recently I received an interesting opportunity within my company to move over to a PHP project. I have only a basic understanding of PHP, although I'm sure I could increase my knowledge if that was my sole focus. The department manager who offered the opportunity understands that my background is in Java.
What type of implications would switching over to PHP have? I know it would make me a more rounded developer and hopefully increase my future job prospects.
Would it have any negative side effects? If I worked on PHP for 1 or 2 years, would my lack of recent Java work hurt my chances when applying to future Java jobs?
I know recruiters often tend to pigeon-hole people into 'Java Developer' or 'PHP Developer'. How do I build a successful career spanning multiple languages.
I think you should take it. You have the opportunity to gain experience in something new while getting paid for it. Just make sure not to let your Java skills atrophy. You are correct that some employers will care what language you work in. Which means you need to be able to code Java/talk about your Java experience at an interview.
As far as future employers, your Java and PHP experience is in the same company. No need to assign them specific dates on your resume.