diff --git a/src/applications/diffusion/controller/symbol/DiffusionSymbolController.php b/src/applications/diffusion/controller/symbol/DiffusionSymbolController.php index 4d5a69702e..9e4d5a35d1 100644 --- a/src/applications/diffusion/controller/symbol/DiffusionSymbolController.php +++ b/src/applications/diffusion/controller/symbol/DiffusionSymbolController.php @@ -65,11 +65,23 @@ final class DiffusionSymbolController extends DiffusionController { // For PHP builtins, jump to php.net documentation. if ($request->getBool('jump') && count($symbols) == 0) { if ($request->getStr('lang') == 'php') { - if ($request->getStr('type') == 'function') { - if (in_array($this->name, idx(get_defined_functions(), 'internal'))) { - return id(new AphrontRedirectResponse()) - ->setURI('http://www.php.net/function.'.$this->name); - } + switch ($request->getStr('type')) { + case 'function': + $functions = get_defined_functions(); + if (in_array($this->name, $functions['internal'])) { + return id(new AphrontRedirectResponse()) + ->setURI('http://www.php.net/function.'.$this->name); + } + break; + case 'class': + if (class_exists($this->name) || + in_array($this->name, get_declared_interfaces())) { + if (id(new ReflectionClass($this->name))->isInternal()) { + return id(new AphrontRedirectResponse()) + ->setURI('http://www.php.net/class.'.$this->name); + } + } + break; } } }