ReflectionClass::getExtension

( excerpt from http://php.net/manual/en/reflectionclass.getextension.php )

public function getExtension(): ?ReflectionExtension;

Gets a ReflectionExtension object for the extension which defined the class.

Returns

  • mixed - A ReflectionExtension object representing the extension which defined the class, or NULL for user-defined classes.