There are two functions like this: {code ...} $ fn indicates the function operation passed in. I know this can be written: {code ...} on the Internet, we can use HHVM to write: {code ...} I have read the HHVM project and it seems a bit complicated. Is there any simple way to directly use p... there are two functions like this:
function fun1(callable $fn){ return $fn();}
$ Fn indicates the function operation passed in, which can be written as follows:
$num = 5;$res = fun1(function () use ($num) { $count = 10*$num; return $count;});
It is said that HHVM can be written as follows:
$res = retry(5, () ==> 10*$num);
I have read about the HHVM project and it seems complicated. Is there any simple way to directly use php to implement this syntax.
Reply content:
There are two functions like this:
function fun1(callable $fn){ return $fn();}
$ Fn indicates the function operation passed in, which can be written as follows:
$num = 5;$res = fun1(function () use ($num) { $count = 10*$num; return $count;});
It is said that HHVM can be written as follows:
$res = retry(5, () ==> 10*$num);
I have read about the HHVM project and it seems complicated. Is there any simple way to directly use php to implement this syntax.
Php does not have a shorthand syntax for this. You can only write it honestly.function
At the beginning, I started to pretend to be B, and I couldn't even understand it later.
It should not exist unless you implement a lexical analyzer ..