<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: method_exists() vs. is_callable()</title>
	<atom:link href="http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/</link>
	<description>LAMP Web Architect</description>
	<lastBuildDate>Thu, 19 Apr 2012 13:32:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Baz</title>
		<link>http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/#comment-10875</link>
		<dc:creator>Baz</dc:creator>
		<pubDate>Thu, 19 Apr 2012 13:32:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/#comment-10875</guid>
		<description>It would be better design to implement an interface. I shouldn&#039;t have to guess whether a given object has a specific method, it should be defined by the class.</description>
		<content:encoded><![CDATA[<p>It would be better design to implement an interface. I shouldn&#8217;t have to guess whether a given object has a specific method, it should be defined by the class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Homeslice</title>
		<link>http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/#comment-10854</link>
		<dc:creator>Homeslice</dc:creator>
		<pubDate>Thu, 19 Apr 2012 08:46:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/#comment-10854</guid>
		<description>Good article. It makes perfect sense using is_callable to check for static methods, yet all private method names should be prepended with an underscore anyhow...</description>
		<content:encoded><![CDATA[<p>Good article. It makes perfect sense using is_callable to check for static methods, yet all private method names should be prepended with an underscore anyhow&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dbind</title>
		<link>http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/#comment-2980</link>
		<dc:creator>dbind</dc:creator>
		<pubDate>Wed, 16 Mar 2011 13:53:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/#comment-2980</guid>
		<description>@mdomba, it depends on what you&#039;re attempting.

1. If you just want to make sure you can call it, use is_callable. If you need to make sure that the method exists by that name (meaning it&#039;s not callable just through a magic method) then use both.

2. If you just want to know if the method exists, not caring whether you can call it at that point, then method_exists alone is enough.

3. If you want to call the method and you don&#039;t care why or how it&#039;s callable, but just that it is, then use is_callable alone.

Just notice the purpose of each: is_callable tells you whether calling it will abort the script with an error, while method_exists tells you if that method was actually hard-coded in a particular class, not caring if it&#039;s gonna explode in your face when you try to call it.</description>
		<content:encoded><![CDATA[<p>@mdomba, it depends on what you&#8217;re attempting.</p>
<p>1. If you just want to make sure you can call it, use is_callable. If you need to make sure that the method exists by that name (meaning it&#8217;s not callable just through a magic method) then use both.</p>
<p>2. If you just want to know if the method exists, not caring whether you can call it at that point, then method_exists alone is enough.</p>
<p>3. If you want to call the method and you don&#8217;t care why or how it&#8217;s callable, but just that it is, then use is_callable alone.</p>
<p>Just notice the purpose of each: is_callable tells you whether calling it will abort the script with an error, while method_exists tells you if that method was actually hard-coded in a particular class, not caring if it&#8217;s gonna explode in your face when you try to call it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mdomba</title>
		<link>http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/#comment-2482</link>
		<dc:creator>mdomba</dc:creator>
		<pubDate>Wed, 16 Feb 2011 09:49:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/#comment-2482</guid>
		<description>So to be sure for all situations... the best usage would be...

if method_exist(...) &amp;&amp; is_callable(...)</description>
		<content:encoded><![CDATA[<p>So to be sure for all situations&#8230; the best usage would be&#8230;</p>
<p>if method_exist(&#8230;) &amp;&amp; is_callable(&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abcphp.com</title>
		<link>http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/#comment-17</link>
		<dc:creator>abcphp.com</dc:creator>
		<pubDate>Sun, 03 Jan 2010 10:49:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/#comment-17</guid>
		<description>&lt;strong&gt;method_exists() vs. is_callable()...&lt;/strong&gt;

One thing I often see when re-factoring PHP applications, is the improper use of the method_exists() function, and I think this needs a little bit of clarification....</description>
		<content:encoded><![CDATA[<p><strong>method_exists() vs. is_callable()&#8230;</strong></p>
<p>One thing I often see when re-factoring PHP applications, is the improper use of the method_exists() function, and I think this needs a little bit of clarification&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: method_exists() vs. is_callable() &#124; Coder Online</title>
		<link>http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/#comment-15</link>
		<dc:creator>method_exists() vs. is_callable() &#124; Coder Online</dc:creator>
		<pubDate>Sun, 03 Jan 2010 08:30:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jmfeurprier.com/2010/01/03/method_exists-vs-is_callable/#comment-15</guid>
		<description>[...] Read more: method_exists() vs. is_callable() [...]</description>
		<content:encoded><![CDATA[<p>[...] Read more: method_exists() vs. is_callable() [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

