Re: Why does `setcookie` send header before throwing `Error` exception?

From: Date: Sun, 04 Apr 2021 23:54:00 +0000
Subject: Re: Why does `setcookie` send header before throwing `Error` exception?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-327538@lists.php.net to get a copy of this message
Thanks for your reply JEFFRY KILLEN,
Could it be sending the header and then choking because ‘path’ doesn’t have a valid value assignment? Maybe, but it does not happen when using this invocation:
setcookie('name', 'value', 1, new Foo()); which should be equivalent to: setcookie('name', 'value', array( 'expires' => 1, 'path' => new Foo() )); The fatal error that they throw is not the issue I'm referring to, but the fact that one syntax sends the Set-Cookie response header but the other one does not.

« previous php.general (#327538) next »