Reflection in PHP projects

Reflection in software development means that a program knows its own structure & can also modify it. Here we explain how it works in practical terms.

by Manuel Wutte
Reading time 15 min
ManuelWutte Blog Teaser
Software Development
ManuelWutte Blog Teaser

The term “reflection” in software development means that a program knows its own structure at runtime and can also modify it. This capability is also referred to as “introspection”. In the PHP area, reflection is used to ensure type safety in the program code. As web developer at Anexia I know PHP like the back of my hand and I just use reflection quite often. Below I will explain how it works in practical terms, and why it is a very useful tool.