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.
2.1m questions
2.1m answers
60 comments
57.0k users