He was damn afraid that you were obviously much better than him.
I'm the only developer in a small company for 2 years, when I started there were a few developers who hated me eventhough I was just a beginner.
Luckly they all got fired or quitted, I think the same thing would happen to me if they pushed it as hard as that guy did with you.
- I do agree that you didn't get hired to be a PHP Developer but I think you shouldn't care about it since in small companies you will always do more than you are hired for, I also agree that that guy was just trying piss you off.
- There's nothing wrong about asking anything on Stackoverflow, I never did myself but I think it would have helped me. That guy is crazy for following you.
- He is a normal guy living in his bubble where he doesn't change, it's like somebody who doesn't move from typewriters to computers and hate who does.
I don't really know what I would do in your position, he's there since the beginning, pretty sure he is important to (or one of) the founders.
Hope you get a much better job soon!