- var_dump: documentation ( source)
- get_object_vars: documentation ( source)
<?php
class A
{
private $a = 1;
protected $b = 2;
public $c = 3;
static public function get_public_vars($object)
{
$get_public_vars = Closure::bind(function($object) {
return get_object_vars($object);
}, null, 'stdClass');
return $get_public_vars($object);
}
}
var_dump(A::get_public_vars(new A));