Is there any functions or how to var_dump() object without showing it protected and private property?
example:
class foo {
public $public = 'public';
protected $protected = 'protected';
private $private = 'private';
}
$Foo = new foo;
var_dump($Foo);
// Expected output "(string) public"
As this page shows, you can just loop over the object:
If you want to make your own var dump, you can do it as so:
The reason this works is because when you access the object outside of itself, you only have access to its public facing member variables.