<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: PHP: The Problem With is_callable() And __call()</title>
	<link>http://blog.charcoalphile.com/2009/04/22/php-the-problem-with-is_callable-and-__call/</link>
	<description>On Databases, Recovery, Tech</description>
	<pubDate>Sat, 31 Jul 2010 08:34:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: admin</title>
		<link>http://blog.charcoalphile.com/2009/04/22/php-the-problem-with-is_callable-and-__call/#comment-3751</link>
		<author>admin</author>
		<pubDate>Thu, 23 Apr 2009 19:20:42 +0000</pubDate>
		<guid>http://blog.charcoalphile.com/2009/04/22/php-the-problem-with-is_callable-and-__call/#comment-3751</guid>
		<description>Ugh. Sorry. I should probably stop posting comments when I'm tired.

Yeah, you might be able to infer the behavior of is_callable() from the documentation, but thats an assumption. In some places, the documentation doesn't give a good enough description of how things function under certain situations. I've ran into this a couple times before.</description>
		<content:encoded><![CDATA[<p>Ugh. Sorry. I should probably stop posting comments when I&#8217;m tired.</p>
<p>Yeah, you might be able to infer the behavior of is_callable() from the documentation, but thats an assumption. In some places, the documentation doesn&#8217;t give a good enough description of how things function under certain situations. I&#8217;ve ran into this a couple times before.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Eure</title>
		<link>http://blog.charcoalphile.com/2009/04/22/php-the-problem-with-is_callable-and-__call/#comment-3725</link>
		<author>Ian Eure</author>
		<pubDate>Thu, 23 Apr 2009 05:11:43 +0000</pubDate>
		<guid>http://blog.charcoalphile.com/2009/04/22/php-the-problem-with-is_callable-and-__call/#comment-3725</guid>
		<description>Not sure I follow you. Assuming you can tell what by looking at the function name?</description>
		<content:encoded><![CDATA[<p>Not sure I follow you. Assuming you can tell what by looking at the function name?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://blog.charcoalphile.com/2009/04/22/php-the-problem-with-is_callable-and-__call/#comment-3721</link>
		<author>admin</author>
		<pubDate>Thu, 23 Apr 2009 04:10:14 +0000</pubDate>
		<guid>http://blog.charcoalphile.com/2009/04/22/php-the-problem-with-is_callable-and-__call/#comment-3721</guid>
		<description>The documentation should really clarify this. Assuming you can tell by looking at the function name is stupid. There's a lot of little things like this in PHP, that drive me crazy.
</description>
		<content:encoded><![CDATA[<p>The documentation should really clarify this. Assuming you can tell by looking at the function name is stupid. There&#8217;s a lot of little things like this in PHP, that drive me crazy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Eure</title>
		<link>http://blog.charcoalphile.com/2009/04/22/php-the-problem-with-is_callable-and-__call/#comment-3719</link>
		<author>Ian Eure</author>
		<pubDate>Thu, 23 Apr 2009 02:15:24 +0000</pubDate>
		<guid>http://blog.charcoalphile.com/2009/04/22/php-the-problem-with-is_callable-and-__call/#comment-3719</guid>
		<description>Yeah, I don’t think it’s explicitly documented, but it’s not a stretch to infer it:

“__call() is triggered when invoking inaccessible methods in an object context.”
“is_callable —  Verify that the contents of a variable can be called as a function”

I don’t know whether it really qualifies as brain-damaged, but it could be more obvious.

The only way around it would be reflection and dynamic instances, so you could look at an object’s methods and replicate them in your object. This would solve it for a Decorator implementation, but I’m sure there are usecases where it’s less optimal.

PHP really isn’t flexible enough to support a fully dynamic programming model like that, though.</description>
		<content:encoded><![CDATA[<p>Yeah, I don’t think it’s explicitly documented, but it’s not a stretch to infer it:</p>
<p>“__call() is triggered when invoking inaccessible methods in an object context.”<br />
“is_callable —  Verify that the contents of a variable can be called as a function”</p>
<p>I don’t know whether it really qualifies as brain-damaged, but it could be more obvious.</p>
<p>The only way around it would be reflection and dynamic instances, so you could look at an object’s methods and replicate them in your object. This would solve it for a Decorator implementation, but I’m sure there are usecases where it’s less optimal.</p>
<p>PHP really isn’t flexible enough to support a fully dynamic programming model like that, though.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
