This has nothing to do with PHP... PHP is a server side technology, while CSS is client side. They don't ever interact directly.
So what you're saying is that if you put your input[type="text"] definition first, it works, if you put your input[type="password"] definition first, it works, but neither works when it comes after the other?
What browser are you using/testing on? Can you show an example of the HTML you're testing it on? Any other conflicting definitions later on?
From this information alone, I don't see any issue with your CSS and have insufficient information to find an answer.
Given they have the same attributes, why not make them one definition?