加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

如何在Symfony 2.8中使用PHP 5.6可变参数函数参数?

发布时间:2020-12-13 13:28:06 所属栏目:PHP教程 来源:网络整理
导读:我有variadic参数的服务方法: public function callSP($namespace,$function,...$params) {} 这被编译成容器,如: public function callSP($namespace,$params = null) 所以它导致: Strict Standards notice saying that callSP() should be compatible wi
我有variadic参数的服务方法:
public function callSP($namespace,$function,...$params) {}

这被编译成容器,如:

public function callSP($namespace,$params = null)

所以它导致:

Strict Standards notice saying that callSP() should be compatible with XXXXXXService::callSP($namespace,…$params)

甚至找不到任何有关此问题的问题.

我想,某种懒惰服务(侦听器或显式懒惰:true)会出现问题

延迟服务使用ocramius / proxy-manager库进行操作.

从2.0版开始,该库引入了对可变参数的支持,至少需要PHP 7.0.

所以我认为这里与5.6无关.

链接:

> https://symfony.com/doc/current/service_container/lazy_services.html
> https://github.com/Ocramius/ProxyManager/releases/tag/2.0.0
> https://github.com/Ocramius/ProxyManager/issues/307

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读