Yii 分配 return of require?帮助理解
Yii assigns return of require? Help to understand
我刚刚在 Yii 中找到了以下代码 MessageCommand.php
$config=require($args[0]);
$translator='Yii::t';
extract($config);
https://github.com/yiisoft/yii/blob/master/framework/cli/commands/MessageCommand.php 第 82 行
我认为 require 只能 return true 或 false。
任何人都可以告诉我这个片段。
它是来自包含范围的 return 变量(如果有 'return' 语句):
//index.php
$a = include('a.php');
echo $a;//12
///file a.php
<?php
return 12;
我刚刚在 Yii 中找到了以下代码 MessageCommand.php
$config=require($args[0]);
$translator='Yii::t';
extract($config);
https://github.com/yiisoft/yii/blob/master/framework/cli/commands/MessageCommand.php 第 82 行
我认为 require 只能 return true 或 false。
任何人都可以告诉我这个片段。
它是来自包含范围的 return 变量(如果有 'return' 语句):
//index.php
$a = include('a.php');
echo $a;//12
///file a.php
<?php
return 12;