"; // 2. Assign a function to a variable, making the variable of type function, // then call the variable, pass the argument $callable = function (float $value): int { if (0 <= $value) { return 1; } return -1; }; echo $callable(-9.4) . " : " . $callable(9.4); echo "
"; ////////////// // Typically, we don't need to specify types $callable2 = function ($value) { if (0 <= $value) { return 1; } return -1; }; echo $callable2(-9.4) . " : " . $callable2(9.4); ?>