The toArray() method returns an array representation of your records or collections. It also accesses the relationships the objects may have. If you need to print a record for debugging purposes you can get an array representation of the object and print that.
// test.php
// ...
print_r($user->toArray());
If you do not want to include the relationships in the array then you need to pass the $deep argument with a value of false:
// test.php
// ...
print_r($user->toArray(false));