解析explode('-','foo-bar')[0]上的错误(例如) [英] Parse error on explode('-','foo-bar')[0] (for instance)
本文介绍了解析explode('-','foo-bar')[0]上的错误(例如)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么php不支持此语法:
Why doesn't php support this syntax:
$s = explode('-', 'foo-bar')[0];
?
推荐答案
这是PHP解析器中的一个限制.没有理由不支持这种减少形式,只是不支持.
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.
这篇关于解析explode('-','foo-bar')[0]上的错误(例如)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文