<?php
class A
{
    static function _b($obj, $hello, $world)
    {
        if (isset($obj)) {
            echo "non-static: $hello $world\n";
        } else {
            echo "static: $hello $world\n";
        }
    }

    function __call($method, $args)
    {
        if ($method == 'b') {
            call_user_func_array(
                array($this, '_' . $method),
                array_merge(array($this), $args)
            );
        }
    }

    static function __callStatic($method, $args)
    {
        if ($method == 'b') {
            call_user_func_array(
                array(get_class(), '_' . $method),
                array_merge(array(null), $args)
            );
        }
    }
}
A::b('hello', 'world');
$a = new A();
$a->b('hello', 'world');
?>