- var_dump: documentation ( source)
- json_encode: documentation ( source)
<?php
class tmp{
public $a = 4;
private $b = 5;
public function setA($a){
$this->a = $a;
}
}
$test = new tmp();
var_dump(json_encode($test));
$test->setA($a);
var_dump(json_encode($test));