3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace HookInvoker\FileSystem { class PhpFunctionProducer { const FUNCTION_CODE = <<<PHP <?php /** * This function wau auto created, pleaee do not edit */ function :function: () { return \DrupalContainer\Registry::getContainer() ->get(':class:') ->hook(func_get_args()); } PHP; public function getPhpFunctionCode() { return self::FUNCTION_CODE; } public function create($function) { $code = str_replace( [':function:', ':class:'], [$function, 'sds.module.user_install'], $this->getPhpFunctionCode()); echo $code; } } } namespace { $x = new HookInvoker\FileSystem\PhpFunctionProducer(); $x->create('test_init'); }

preferences:
42.67 ms | 402 KiB | 5 Q