@NogDogDec 14.2020 — #__(The following does not really address your question, please see my later reply. :) )__
Create a public method that returns the property of interest. <i> </i>class Foo private $bar = [1, 2, 3]; public function bar() { return $this->bar; } }
$foo = new Foo(); $foo_json = json_encode($foo->bar());