<?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>Wed, 22 May 2013 00:59:38 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Jacob Santos' Blog: Global Functions and How to Not Use Them]]></title>
      <guid>http://www.phpdeveloper.org/news/5979</guid>
      <link>http://www.phpdeveloper.org/news/5979</link>
      <description><![CDATA[<p>
In his <a href="http://www.santosj.name/?p=274">latest post</a>, <i>Jacob Santos</i> talks about global functions and some of the dangers behind using them in your code (as per his own experience debugging with them in place).
</p>
<blockquote>
When I develop in PHP and code functions, I always either place them in a file or place them at the top of the script. Well, this is more about C++ and how I totally freaked out my teacher, by breaking his paradigm of thought. You see, you can have a definition of a function at the top of the page and then code the body of the function later.
</blockquote>
<p>
He <a href="http://www.santosj.name/?p=274">soon discovered</a> his problem in debugging the script - he was too used to having the global functions at the top (as in C++) and not mixed in with the code - or at the bottom of the script. 
</p>
<blockquote>
If there is something at least somewhat common about popular scripts that people use and extend, is that the functions are placed in organized manner. Reforming otherwise is a bitch and I remember rewriting the entire script anyway. You can't reform when you can't reuse anything.
</blockquote>]]></description>
      <pubDate>Tue, 08 Aug 2006 06:26:32 -0500</pubDate>
    </item>
  </channel>
</rss>
