Does it contain any other criteria or something more?
I tested on my domain and /php is not blocked, neither /abcdphp, but something.php is blocked using contains "php" - but that’s my VueJS app running on a Firebase hosting.
I use .php in my Firewall Rules to block access to PHP files in some combination of the specific path/directory too.
UPDATE: Ok, contains "php" works for me. I mispelled it wrong in the expression field.