Can anyone explain why these two pieces of code act differently and what I'm doing wrong:
print_r($user['first_signed_up_date']);
echo $user['first_signed_up_date']->milliseconds/1000;
Result:
MongoDB\BSON\UTCDateTime Object
(
[milliseconds] => 1507976375000
)
1507976375
Second code:
// removed print_r / var_dump
echo $user['first_signed_up_date']->milliseconds/1000;
Result:
0
The only difference between first and second code is there's no print_r (var_dump has same result)