I defined a function which I want to use hash table like parameter inside.
function Foo($param)
{
// Here, I should get fener as key, and bahce as value.
}
Foo('fener' => 'bahce'); // Is there a way like .net's lambda expression ?
And I don t want to use Foo(array('fener' => 'bahce'))
// it is possible I know..
One way or the other you will have to declare your array with array()
:
$args = array('fener' => 'bahce');
Foo($args);
or directly:
Foo(array('fener' => 'bahce'));
Edit
As of PHP 5.4 you can also do (from the manual):
// as of PHP 5.4
$array = [
"foo" => "bar",
"bar" => "foo",
];
So you might get away with:
Foo(['fener' => 'bahce']);