Why doesn\'t php support this syntax:
$s = explode(\'-\', \'foo-bar\')[0];
?
It's a limitation in the PHP parser. There's no reason why it can't support this form of reduction, it just doesn't.