- var_dump: documentation ( source)
- get_object_vars: documentation ( source)
- json_encode: documentation ( source)
<?php
class test{
public $test = "toto";
private $esaegaegt = "togaegegto";
public function jsencode(){
return json_encode($this);
}
public function temp(){
$tmp = new \ReflectionClass($this);
var_dump( $tmp );
die();
return json_encode(get_object_vars($this));
}
}
$a = new test();
var_dump($a->temp());