<?php class Foo { public $foo = 'foo'; private $bar = 'bar'; public function toArray() { return (array)$this; } } var_dump((new Foo)->toArray(), (array)$this);
You have javascript disabled. You will not be able to edit any code.