it looks
like calling new foo() from within the class def would
make it recursively trying to set the cookie.
Actually, the class def begins in one line and ends in the next line (the line new Foo() is outside of the class def), did I misunderstand something?; it is similar to this:
class Foo {}
which is small enough for illustrating what I think is a discrepancy between the two calls I mentioned in previous messages:
setcookie('name', 'value', 1, new Foo());
and
setcookie('name', 'value', array(
'expires' => 1,
'path' => new Foo()
));
The former does not send any header but the latter does.