简体   繁体   中英

“Strict Standards”-Error after PHP-Update

i need to update my php-version. The site still runs with 5.2. The problem is every newer version results in an error.

Errors at php version 5.3+:

  • Strict Standards: Only variables should be passed by reference in /xxx/xxx on line 52
  • Strict Standards: Only variables should be passed by reference in /xxx/xxx on line 84
  • Strict Standards: Only variables should be passed by reference in /xxx/xxx on line 85

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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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