It won't search dir1, dir2 or dir3 as they are not included on the command line.
You could try
grep -r "abc" '*.php'
to see if grep can do the filename expansion itself (and if it does, wether is does it differently to your shell), though I don't think that will work either (or if it does I think it will work the same way your current command is doing).
What I would first think of doing in this case would be
find . -name '*.php' | xargs grep -r "abc"
which will work unless you have many many files matching *.php in directories under your current location (in which case you will probably get a "command line too long" or similar error message.