Answer the question
In order to leave comments, you need to log in
How to create a callback in php?
how to create a function in php like this:
name_func(function(){
//code
});
I know how to do this in js, but is the implementation in php interesting?
Answer the question
In order to leave comments, you need to log in
function foo(callable $bar)
{
$bar();
}
foo(function () {
echo 5;
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question