I simply cannot find an explanation for this bizarre behavior:
Given the following array:
array (size=2)
0 =>
object(Craft\DateTime)[225]
public 'date' => string '2017-02-01 00:00:00.000000' (length=26)
public 'timezone_type' => int 3
public 'timezone' => string 'UTC' (length=3)
1 =>
object(Craft\DateTime)[231]
public 'date' => string '2017-02-02 00:00:00.000000' (length=26)
public 'timezone_type' => int 3
public 'timezone' => string 'UTC' (length=3)
If I do the following:
foreach($myArray as $data){
var_dump($data->date);
}
The result of the var_dump is NULL. Not only is that incorrect but if before the foreach I add the following:
var_dump($test);
I then get output. So how could a var_dump
possibly have any bearing on the value of itself. It just doesn't make any sense.