This is the PHP Code:
define( 'FN_PREFIX', 'prefix_' );
${ FN_PREFIX . 'function_name' } = function( $string ) {
echo $string;
};
$prefix_function_name( 'This is Working!!!' );
The Result:
This is Working!!!
No...! This is not at all standard .You have classes and methods with access specifiers and return types (PHP 7) to serve the purpose. Closure has different purpose.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.