PHP OOP - private variable accessible from outside class with var_dump? -


i have class user variable: private $upass;

i noticed when creating instance of user , run var_dump on instance lists private variables? there way turn off?

class user {     private $uid;     private $uname;     private $upass;     private $upowers;  $teammembers[$count] = new user();  foreach ($teammembers $teammember) {     var_dump($teammember); } 

and output shows everything, including passwords ... ofcourse they're encrypted, still don't want them accessible this!?

what's correct way solve this?

it's doing says does:

all public, private , protected properties of objects returned in output unless object implements __debuginfo() method (implemented in php 5.6.0).

so can implement custom __debuginfo method, or alternatively, stop worrying it. security risk if has access source code, or serialized copy of object, both of signs of wider security issue.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -