【问题标题】:PHP7 compatibility testPHP7兼容性测试
【发布时间】:2020-12-16 15:48:06
【问题描述】:

用 php7mar 检查我们的代码后,有一些条目 在报告中类似于以下内容:

  #### /includes/classes/class.shopdb.php
* funcGetArg
 * Line 206: `                  $args = func_get_args();`

当我检查指定的文件和代码时,这就是我所拥有的:

    if(func_num_args() > 1) {
        $args = func_get_args();
        foreach($args as &$item)
            $item = ShopDB::quote($item);
        $query = vsprintf(str_replace('?', '%s', $query), array_slice($args, 1));
    }

我真的看不出有什么问题... 还有其他人吗?

【问题讨论】:

标签: php-7.1


【解决方案1】:

经过一番搜索,func_get_args 在 php7 中应该可以正常工作。 php7mar报告中还有几行我看不懂:

  • 变量插值

  • 第 370 行: return $this->smarty->registered_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, $this);

  • 第 441 行: return $this->default_handler_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, $this);

  • 第 481 行: return $this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][0][0]->$function[1]($args, $this);

  • 第 63 行: $this->$row[0] = $row[1];

  • newOperatorWithReference

  • 第 53 行: * Remember to use ampersand when creating an OLE object ($my_ole =& new OLE();)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-20
    • 2011-12-15
    • 2011-10-28
    • 2011-09-09
    相关资源
    最近更新 更多