{"id":9468419,"date":"2017-09-05T07:35:21","date_gmt":"2017-09-05T07:35:21","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/php-warning-when-using-debugcookie\/"},"modified":"2017-09-05T07:35:21","modified_gmt":"2017-09-05T07:35:21","slug":"php-warning-when-using-debugcookie","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/php-warning-when-using-debugcookie\/","title":{"rendered":"PHP Warning when using ?debugcookie=#"},"content":{"rendered":"<p>Apparently, the plugin&#8217;s code tries to use a <code>DateTime<\/code> object as the third parameter to <code>setcookie()<\/code>.<\/p>\n<p>This is the PHP warning and last step in stack trace:<\/p>\n<pre><code>\nPHP Warning:  setcookie() expects parameter 3 to be integer, object given in \/var\/www\/[redacted]\/wp-content\/plugins\/debug-objects\/debug-objects.php on line 317\n[...]\nPHP  11. setcookie(&#039;debug_objects_cookie&#039;, &#039;Debug_Objects_True&#039;, class DateTime { public $date = &#039;2017-09-06 07:25:26.000000&#039;; public $timezone_type = 3; public $timezone = &#039;UTC&#039; }, &#039;\/&#039;, FALSE) \/var\/www\/[redacted]\/wp-content\/plugins\/debug-objects\/debug-objects.php:317\n<\/code><\/pre>\n<p>Please turn on <code>WP_DEBUG<\/code> constant and set error reporting to <code>E_ALL<\/code> while developing. That will save a lot of headaches to you and other fellow developers.<\/p>\n","protected":false},"template":"","class_list":["post-9468419","topic","type-topic","status-publish","hentry","topic-tag-php-warnings"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9468419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9468419\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9468419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}