action方法会污染参数

浏览:1038 发布日期:2016/12/24
5.0.0 - 普通 - 已关闭
<?php
namespace app\index\controller;

class Index
{
    public function index()
    {
        $a = ['neq', 'hello'];
        $b = ['eq', 'hello'];
        
        action('test', [$a, $b]);
    }
    
    public function test($a, $b)
    {
        dump($a);
        dump($b);
    }
}
运行结果array(2) {
  [0] => string(4) "neq "
  [1] => string(5) "hello"
}
array(2) {
  [0] => string(2) "eq"
  [1] => string(5) "hello"
}
neq被多加了个空格,eq却没有
评论(
后面还有条评论,点击查看>>