I want to create and execute a closure within a string in PHP and it's not liking the way that I do it.
This code doesn't work...
echo ( 'Hello, ' . (function($s) { return $s; })('World!') );
Yet, this is completely valid and works as intended...
$f = (function($s) { return $s; });
echo ( 'Hello, ' . $f('World!') );
Why won't the first one work and is there a way to do it in one line (not because I think it's efficient, because I'm sure it's not)?