<?php

class Hello
{
    final public function speak($name)
    {
        echo 'Non-Static called';

        return 'Hello ' . $name;
    }

    final public static function __callStatic($method, array $params)
    {
        echo 'Static called';

        if (method_exists(__CLASS__, $method) === false) {
            $message = sprintf(
                'Call to undefined method %s::%s()',
                get_called_class(),
                $method
            );
            throw new \UnexpectedValueException($message);
        }

        return call_user_func_array([new static, $method], $params);
    }
}


echo Hello::speak('world'); // Hello world

