Conversation
review · 5 starsFatal error: Cannot use $this as parameter in …public_html/x.pp.ua/wp-content/plugins/exchange-rates-today/exchange-rates-today.php on line 36 =(( This topic was modified 7 years, 6 months ago by tokach .
When translating a site from php 5.6 to 7.xx, you can get the following template error: FATAL ERROR: CAN’T USE THIS AS A PARAMETER IN / TEMPLASTS /****/LAYOUTS/FILE.PHP ON LINE ** Basically, the line that causes this error looks something like this: BDT_HEADERSTYLE FUNCTION ($ IT) It is treated simply: change $ this, for example, to $ then or any other unused variable. Make a replacement in the entire template file.
Thank you a lot, Artyom Now it works. I changed it to $ktoday wich will never be used by other developers, I hope) Maybe you should update your plugins with new variable so more people will use it out of box with no code edits. Thank you. This reply was modified 7 years, 6 months ago by tokach .
When translating a site from php 5.6 to 7.xx, you can get the following template error: FATAL ERROR: CAN’T USE THIS AS A PARAMETER IN / TEMPLASTS /****/LAYOUTS/FILE.PHP ON LINE ** Basically, the line that causes this error looks something like this: BDT_HEADERSTYLE FUNCTION ($ IT) It is treated simply: change $ this, for example, to $ then or any other unused variable. Make a replacement in the entire template file.
Thank you a lot, Artyom Now it works. I changed it to $ktoday wich will never be used by other developers, I hope) Maybe you should update your plugins with new variable so more people will use it out of box with no code edits. Thank you. This reply was modified 7 years, 6 months ago by tokach .