<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP Software Developing &#187; Error handling</title>
	<atom:link href="http://www.phpdeveloping.co.za/tag/error-handling/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phpdeveloping.co.za</link>
	<description>for the love of PHP Development</description>
	<lastBuildDate>Tue, 29 Sep 2009 15:38:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>When a function doesn&#8217;t exist</title>
		<link>http://www.phpdeveloping.co.za/error-handling/when-a-function-doesnt-exist.html</link>
		<comments>http://www.phpdeveloping.co.za/error-handling/when-a-function-doesnt-exist.html#comments</comments>
		<pubDate>Thu, 23 Jul 2009 14:34:02 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Error handling]]></category>
		<category><![CDATA[functions]]></category>

		<guid isPermaLink="false">http://www.phpdeveloping.co.za/?p=50</guid>
		<description><![CDATA[Sometimes we develop PHP scripts that requires other 3rd party libraries or makes use of PHP4 or PHP5 specific functions.  What we then forget is that when we upload it to a server with PHP4 on and we developed for PHP5, we&#8217;re going to end up with a lot of &#8220;function not found&#8221; errors.
Yes, [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we develop PHP scripts that requires other 3rd party libraries or makes use of PHP4 or PHP5 specific functions.  What we then forget is that when we upload it to a server with PHP4 on and we developed for PHP5, we&#8217;re going to end up with a lot of &#8220;function not found&#8221; errors.</p>
<p>Yes, PHP4 is old news, and everyone should be using PHP5 by now, but there are still a lot of times I come across the need for PHP4 development.</p>
<p>What I&#8217;ve started doing is making PHP4 equivalent functions.  But this is not what this post is about, what I want to tell you about is the <a target=_blank href="http://www.php.net/manual/en/function.function-exists.php">function_exists</a> function.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span>’FUNCTION_CALL’<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  FUNCTION_CALL<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>You can define your own function by doing this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span>’FUNCTION_CALL’<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">function</span> FUNCTION_CALL<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;this function does something&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The above will only create your own function is the function doesn&#8217;t already exist.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpdeveloping.co.za/error-handling/when-a-function-doesnt-exist.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
