Archive for April, 2009

PHP: The Problem With is_callable() And __call()

Wednesday, April 22nd, 2009

So I ran into this problem with PHP: when you have a class that uses method overloading via __call(), is_callable() will always return true for any function given to it, no matter if it exists or not. I know this is by design, but it’s still heavily brain-damaged. Here’s an example of what I’m talking about:


class foo {

    public function __call($name, $args)
    {
        echo "$name called\n";
    }
}

$foo = new foo();
if (is_callable(array($foo, 'non_existent_method'))) {
    echo "foo->non_existant_method() is callable\n";
}

My whole problem with this, is it’s completely undocumented. If you use method_exists(), you may expect it to return true for method overloading, but that’s not the case.

So:
is_callable() - Recognizes __call()
method_exists() - Doesn’t recognize __call()

More On Comcast’s Move To Digital

Thursday, April 9th, 2009

Comcast’s plan to transition to digital is well on it’s way in Seattle/Tacoma. Infrastructure is being upgraded in many areas to increase HDTV capacity, which mostly involves upgrading old systems to an 860Mhz system. In some areas, analog channels are already in the process of being shut off. They’re not shut off yet; currently they display a screen with a phone number to call to order a digital cable box, but they’re sure to be shut off in the near future.

The space freed by the analog channels will be used primarily for HDTV. This is something Comcast desperately needs in order to compete with DirecTV and Verizon FiOS. Brier Dudley of the Seattle Times, posted a blog entry that explains which areas are expected to have their analog shut off.

Asking Who For What?

Thursday, April 2nd, 2009

I recently stumbled across this gem, from a website called Minda News… I think the Moro Islamic Liberation Front should consider a name change. Click the image for full view.

Moro Islamic Liberation Front (MILF)

Note that “cell phone” is also horribly misspelled.