Basically, if you'd want any type of variable to work in a foreach like it should, it should fall into the iterable pseudo-type.
So if you use a variable that does not fall into the iterable pseudo-type, in a foreach an error would spring up.
And in your case, i.e. private $foo; if you leave it like that, it basically contains the value null which does not fall into iterable, so it would fail.
Whereas, if you use private $foo = []; it contains an empty array, which indeed does fall into the iterable pseudo-type and can be used flawlessly in a foreach.
private $valuewould generate an error if I tried to run aforeachon it when empty?