[Router] added static requirement optimization to php matcher dumper

This PR attempts to apply #6838 suggestion.
@Tobion could you please take a look and tell me what you think?

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT