{"id":193,"date":"2009-03-06T18:23:23","date_gmt":"2009-03-06T22:23:23","guid":{"rendered":"http:\/\/blogs.n1zyy.com\/andrew\/?p=193"},"modified":"2009-03-06T18:23:23","modified_gmt":"2009-03-06T22:23:23","slug":"every-day","status":"publish","type":"post","link":"https:\/\/blogs.n1zyy.com\/andrew\/2009\/03\/06\/every-day\/","title":{"rendered":"Every day"},"content":{"rendered":"<p>Here are two PHP functions (although one&#8217;s actually from an extension) that I didn&#8217;t know existed, but give you some good insight into your variables, especially when you&#8217;re mucking around with more complicated stuff: <a href=\"http:\/\/us2.php.net\/debug-zval-dump\">debug_zval_dump<\/a> and <a href=\"http:\/\/xdebug.com\/docs\/all_functions#xdebug_debug_zval\">xdebug_debug_zval<\/a>. <\/p>\n<p>Both give you more information about the underlying representation of your variables: in particular, what the refcount is for that particular value. Note, however, that while it&#8217;s literally called the &#8220;reference count&#8221;, a refcount greater than one doesn&#8217;t imply that the variable is actually a <a href=\"http:\/\/us.php.net\/manual\/en\/language.references.whatare.php\">reference<\/a> due to PHP&#8217;s &#8220;copy on write&#8221; semantics. XDebug&#8217;s version of the method wins here, because it also dumps is_ref, which <em>does<\/em> flag a reference.<\/p>\n<p>(See Sara Golemon&#8217;s <a href=\"http:\/\/blog.libssh2.org\/index.php?\/archives\/51-Youre-being-lied-to..html\">You&#8217;re being lied to<\/a> or Derick Rethan&#8217;s <a href=\"http:\/\/derickrethans.nl\/files\/phparch-php-variables-article.pdf\">References in PHP<\/a> [PDF] for more.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here are two PHP functions (although one&#8217;s actually from an extension) that I didn&#8217;t know existed, but give you some good insight into your variables, especially when you&#8217;re mucking around with more complicated stuff: debug_zval_dump and xdebug_debug_zval. Both give you more information about the underlying representation of your variables: in particular, what the refcount is [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,20],"tags":[],"class_list":["post-193","post","type-post","status-publish","format-standard","hentry","category-development","category-php"],"_links":{"self":[{"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/posts\/193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/comments?post=193"}],"version-history":[{"count":0,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/posts\/193\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/media?parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/categories?post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/tags?post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}