Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在查看 Laravel 3 源代码,我在larave/section.php文件中看到了一个奇怪的语法:
larave/section.php
ob_start() and static::$last[] = $section;
这个奇怪的赋值语法是什么?你怎么读?这是否意味着我们正在$section考虑static::$last[]if ob_start()return true?
$section
static::$last[]
ob_start()
true
是的。这是一个简写
if (ob_start()) { static::$last[] = $section; }
由于布尔运算符的短路性质。