create_function() - php 选项信息函数
create_function()
(PHP 4 >= 4.0.1, PHP 5, PHP 7)
Create an anonymous (lambda-style) function
说明
create_function(string $args,string $code): stringCreates an anonymous function from the parameters passed, and returns a unique name for it.
CautionThis function internally performs aneval()and as such has the same security issues aseval(). Additionally it has bad performance and memory usage characteristics.
If you are using PHP 5.3.0 or newer a nativeanonymous functionshould be used instead.
参数
Usually these parameters will be passed as single quote delimited strings. The reason for using single quoted strings, is to protect the variable names from parsing, otherwise, if you use double quotes there will be a need to escape the variable names, e.g.$avar.$args
The function arguments.
$codeThe function code.
返回值
Returns a unique function name as a string,orFALSE
on error.
范例
Creating an anonymous function withcreate_function()
You can use this function, to (for example) create a function from information gathered at run time:
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!