<?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';
'Call to undefined method %s::%s()',
get_called_class(),
$method
);
throw new \UnexpectedValueException($message);
}
}
}
echo Hello::speak('world'); // Hello world
PD9waHAKCmNsYXNzIEhlbGxvCnsKICAgIGZpbmFsIHB1YmxpYyBmdW5jdGlvbiBzcGVhaygkbmFtZSkKICAgIHsKICAgICAgICBlY2hvICdOb24tU3RhdGljIGNhbGxlZCc7CgogICAgICAgIHJldHVybiAnSGVsbG8gJyAuICRuYW1lOwogICAgfQoKICAgIGZpbmFsIHB1YmxpYyBzdGF0aWMgZnVuY3Rpb24gX19jYWxsU3RhdGljKCRtZXRob2QsIGFycmF5ICRwYXJhbXMpCiAgICB7CiAgICAgICAgZWNobyAnU3RhdGljIGNhbGxlZCc7CgogICAgICAgIGlmIChtZXRob2RfZXhpc3RzKF9fQ0xBU1NfXywgJG1ldGhvZCkgPT09IGZhbHNlKSB7CiAgICAgICAgICAgICRtZXNzYWdlID0gc3ByaW50ZigKICAgICAgICAgICAgICAgICdDYWxsIHRvIHVuZGVmaW5lZCBtZXRob2QgJXM6OiVzKCknLAogICAgICAgICAgICAgICAgZ2V0X2NhbGxlZF9jbGFzcygpLAogICAgICAgICAgICAgICAgJG1ldGhvZAogICAgICAgICAgICApOwogICAgICAgICAgICB0aHJvdyBuZXcgXFVuZXhwZWN0ZWRWYWx1ZUV4Y2VwdGlvbigkbWVzc2FnZSk7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gY2FsbF91c2VyX2Z1bmNfYXJyYXkoW25ldyBzdGF0aWMsICRtZXRob2RdLCAkcGFyYW1zKTsKICAgIH0KfQoKCmVjaG8gSGVsbG86OnNwZWFrKCd3b3JsZCcpOyAvLyBIZWxsbyB3b3JsZAoK