lundi 30 janvier 2017

How can I correctly print the object content in PHP?

I am absolutly new in PHP and moreover in Laravel framework and I have the following problem.

I am doing:

    $attributes = array(
        'id' => $dettagliLogin->id,
        'username' => $dettagliLogin->email,
        'name' => $dettagliLogin->userName,
    );

    $user = new GenericUser($attributes);

    \Log::info('USER: '.(var_dump(($user))));

Where the last line:

\Log::info('USER: '.(var_dump(($user))));

should write the content of the $user object into a log file.

The problem is that into my log file I obtain this output:

[2017-01-30 10:25:19] local.INFO: USER:  

so it is as this object is empty but I think that it is not empty because then is used.

Why? How can I correctly print the object content?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2jlQlpS
via IFTTT

Aucun commentaire:

Enregistrer un commentaire