$config=array( 'host'=>"localhost", 'user'=>"localhost" ); $obj1=(object)$config; echo $obj1->user; //输出 localhost