Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the use of having private properties if you can alter them with reflection?

Tags:

reflection

I know it sounds like a stupid question, but how safe is your API if you can access private properties and change them?

like image 799
Lieven Cardoen Avatar asked Nov 28 '22 11:11

Lieven Cardoen


1 Answers

What's the point of having locks on your door when people can just kick the door down? Using reflection requires more skill and more effort. For the most part the code is fine. Reflection doesn't work well in non full trust environments anyway.

like image 179
RichardOD Avatar answered May 12 '23 05:05

RichardOD