\Jawira\TheLostFunctions\get_short_class

get_short_class - Returns the short name of the class of an object.

Description

get_short_class(string|object $object): string

Gets the short name of the class of the given object.

Parameters

object
An object or a string of the object's full namespace.

Return value

The object's short name.

Example

use function Jawira\TheLostFunctions\get_short_class;

$demo = new \Foo\Bar\Baz();
get_short_class($demo); // Baz
get_short_class(\App\Demo\User::class); // User