I am trying out json_encode
for the first time I created an object
class Test {
public $action= 'sleep';
public function wake() {
$this->action = 'wake';
}
}
then I encode it
$enc_obj = json_encode(new Test());
I then var_dump()ed it
var_dump($enc_obj);
I got a list of the property without the functions
'{"action":"sleep"}'
Am I missing something or that is how it is supposed to work?