简体   繁体   English

“严格标准”-PHP更新后出现错误

[英]“Strict Standards”-Error after PHP-Update

i need to update my php-version. 我需要更新我的php版本。 The site still runs with 5.2. 该站点仍以5.2运行。 The problem is every newer version results in an error. 问题是每个较新的版本都会导致错误。

Errors at php version 5.3+: PHP版本5.3+的错误:

  • Strict Standards: Only variables should be passed by reference in /xxx/xxx on line 52 严格标准:第52行的/ xxx / xxx中只能通过引用传递变量
  • Strict Standards: Only variables should be passed by reference in /xxx/xxx on line 84 严格标准:只有变量应该通过引用在第84行的/ xxx / xxx中传递
  • Strict Standards: Only variables should be passed by reference in /xxx/xxx on line 85 严格的标准:仅变量应通过引用在第85行的/ xxx / xxx中传递

Here are the affected lines: 以下是受影响的行:

52: $this->pathToModule = realpath ( self::$MODULE_DIRECTORY .     DIRECTORY_SEPARATOR . Filter::instance( $tmpStr = $name )->toLowerCase() );
84: $backendClassName   = Filter::instance($tmp = $this->name)->camelize() . self::BACKEND_FILESUFFIX;
85: $frontendClassName  = Filter::instance($tmp = $this->name)->camelize() . self::FRONTEND_FILESUFFIX;

Has anyone an idea where the problem could be? 有谁知道问题可能在哪里?

Thank you in advance, 先感谢您,

Marvin 马文

So set your temps as variables before the Filter call rather than assigning them within the argument: 因此,请将您的临时变量设置为Filter调用之前的变量,而不是在参数中分配它们:

Change 更改

$frontendClassName  = Filter::instance($tmp = $this->name)->camelize() . self::FRONTEND_FILESUFFIX;

to

$tmp = $this->name;
$frontendClassName  = Filter::instance($tmp)->camelize() . self::FRONTEND_FILESUFFIX;

etc 等等

But watch out in case $tmp is modified by the call 但是要小心以防$ tmp被调用修改

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM