- get_object_vars: documentation ( source)
<?php
class toto {
private $maman;
private $papa;
}
$entity = new toto;
function getVars($entity){
return \Closure::bind(function($entity) {
return get_object_vars($entity);
}, null, $entity);
}
getVars($entity);