$newfunc = create_function( '$a,$b' ,'return "ln($a) + ln($b) = ".log($a * $b) ;'); echo "New anonymous function: $newfunc\n"; echo $newfunc(2,M_E) ."\n"; / / outputs / / New anonymous function: lambda_1 / / ln(2) + ln(2.718281828459) = 1.6931471805599
?php $newfunc = create_function( '$a,$b' ,'return "ln($a) + ln($b) = ".log($a * $b) ;'); echo "Nouvelle fonction anonyme: $newfunc\n"; echo $newfunc(2,M_E) ."\n"; / / affichera: / / Nouvelle fonction anonyme: lambda_1 / / ln(2) + ln(2.718281828459) = 1.6931471805599?