3v4l.org

run code in 300+ PHP versions simultaneously
<?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);

preferences:
48.76 ms | 402 KiB | 5 Q