<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 23 May 2013 21:00:37 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Ben Ramsey's Blog: Undefined Constant Is a String?]]></title>
      <guid>http://www.phpdeveloper.org/news/6952</guid>
      <link>http://www.phpdeveloper.org/news/6952</link>
      <description><![CDATA[<p>
Constants can be handy when used correctly. Unfortunately, there's some small issues you might want to watch out for. <i>Ben Ramsey</i> <a href="http://benramsey.com/archives/undefined-constant-is-a-string/">discovered one</a> while working with another's code - an undefined constant acting like a string.
</p>
<blockquote>
From the I-noticed-this-one-day-while-looking-at-a-co-worker's-code department comes a tale about the use of undefined constants in PHP'"and relying on this twisted "feature" to make an application function properly.
</blockquote>
<p>
He <a href="http://benramsey.com/archives/undefined-constant-is-a-string/">relays a little story</a> about the errant code and noticed the constant that wasn't defined and how PHP was treating it like a string. After searching the manual, though, he finds a reference related to the situation showing that it will only throw an E_NOTICE when this happens.
</p>
<p>
<i>Ben</i>'s suggestion is for a bit more than that - at the very least an E_WARNING. Having it down at E_NOTICE won't be seen by most with the default php.ini, and he gives an example as to why it's a bad thing (passing this string/constant into a  function and how it handles it).
</p>]]></description>
      <pubDate>Thu, 21 Dec 2006 07:34:00 -0600</pubDate>
    </item>
  </channel>
</rss>
