minor #18021 Don't use reflections when possible (Ener-Getick)
minor #18021 Don't use reflections when possible (Ener-Getick)

This PR was merged into the 2.3 branch.

Discussion
----------

Don't use reflections when possible

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Use php functions instead of reflection when possible (to improve a bit the performance).

Commits
-------

a46270a Don't use reflections when possible

symfony/serializer,symfony/Serializer