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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Sorry for the typos in my previous message. I stand corrected, it is

>	setcookie('name', 'value', 1, new Foo());

instead of

>	setcookie('name', 'value', 1, => new Foo());

and here is the fixed test file:
	setcookie() sends header before throwing `Error` exception

	class Foo{

	try {
		setcookie('name', 'value', array(
			'expires' => 1,
			'path' => new Foo()
	} catch (\Error $e) {
		echo $e->getMessage() . "\n";

	echo "Done\n";

	Object of class Foo could not be converted to string
	array(1) {
	   string(23) "X-Powered-By: PHP/8.0.3"

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux