22
__debugInfo()
class User {
private $name = "お名前";
private $mail = "
[email protected]";
private $bigObj; // なんかおっきなの
public function __debugInfo() {
return [
"name" => $this->name,
"mail" => "教えないよ",
];
}
}
$user = new User();
var_dump($user);
実行結果
object(User)#1 (2) {
["name"]=>
string(4) "お名前"
["mail"]=>
string(3) "教えないよ"
}