In PHP I have the following construct
$a = array(-1 => '-', 0 => '?', 1 => '+')[1];
which gives a syntax error. Is it still possible to do such things in one convenient line avoiding multiple if/else clases or switch/select statements? I was thinking at python where this work fine:
a = {-1:'-', 0:'?', 1:'+'}[1]