use TYPO3\CMS\Core\Utility\GeneralUtility; $tsfe = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController');
use Vendor\Extension\MyClass; use TYPO3\CMS\Core\Utility\GeneralUtility; $myInstance = GeneralUtility::makeInstance(MyClass::class);In this example, we are using makeInstance to create a new instance of a custom class called MyClass. We use the class keyword to specify the class name. This class is part of a custom extension named Vendor\Extension. Overall, makeInstance is a useful function that makes it easy to create instances of classes in TYPO3. It can be used to create instances of both core and custom classes.