How to use lambda function as a condition in ternary operator?

$string is not defined within the closure and you forgot the return statement.

$string is not defined within the closure and you forgot the return statement function ($x, $y) use ($string) { return strlen($string) >= $y + $x + 1; }.

1 for adding return. I deleted my answer. – webbiedave May 9 '11 at 18:28 Thanks for the hint anyway :) – KingCrunch May 9 '11 at 18:28 No problem.

––– – webbiedave May 9 '11 at 18:29 thak you both, it works. – czarek zmuda May 9 '11 at 18:31.

You're using $string in the lambda, but not passing it in as a parameter or definining it as global within the lambda, so it's null/empty.

2 Please don't recommend global. – KingCrunch May 9 '11 at 18:28.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions