create_function

PHP 4 >= 4.0.1, PHP 5, PHP 7 Deprecated: PHP 7.2.0
create_function - Create a function dynamically by evaluating a string of code
Manual
Code Examples

Example #1 Creating a function dynamically, with create_function or anonymous functions

Result: ln(2) + ln(2.718281828459) = 1.6931471805599
PHP Version:

Example #2 Making a general processing function, with create_function or anonymous functions

Result: Using the first array of dynamic functions parameters: 2.3445, M_PI some trig: -1.6291725057799 a hypotenuse: 3.9199852871011 b*a^2 = 4.8103313314525 min(b^2+a, a^2,b) = 8.6382729035898 ln(a)/b = 0.27122299212594 Using the second array of dynamic functions ** "Twas the night" and "Twas brilling and the slithy toves" ** Look the same to me! (looking at the first 3 chars) CRCs: 3569586014, 342550513 similar(a,b) = 11(45.833333333333%)
PHP Version:

Example #3 Using dynamic functions as callback functions

Result: Array ( [0] => the mango [1] => a mango [2] => that mango [3] => this mango )
PHP Version:


Function create_function:

Function Handling Functions

Most used PHP functions