4

I have an application in which i have to declare (override) methods inherited from an interface. However, these methods have parameters that are not used in my implementation.

class MyImplementation implements ISomething {

  public function foo($bar) {
    // code that does nothing with $bar
    ...
  }

  // other methods
  ...
}

How can I mark $bar as unused in the source code, in C++ this is possible.

In other words, how can I do THIS in PHP?

4

1 回答 1

-2

如果我理解你的问题是正确的,你想在你的 php 脚本中隐藏未初始化变量的错误通知吗?如果是这种情况,您应该更改 php.ini 中的 error_reporting

示例:error_reporting=E_ALL & ~E_NOTICE(显示所有错误,通知除外)

于 2016-03-06T16:48:43.863 回答