How private is private really?

Today i ended up at private properties exposed (Apparently it’s also used by PHPUnit)

class foo {
 private $bar = 42;
} 

$obj = new foo;
$propname="\0foo\0bar";
$a = (array) $obj;
echo $a[$propname];
This entry was posted in PHP. Bookmark the permalink.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>