Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 27 Oct 2021, 19:30
BulliM's Avatar
BulliM BulliM is offline
 
Join Date: Oct 2017
PHP 7 To PHP 8 Issue

Since quite a while I get php 7.3 warnings in Nginx error.log:

FastCGI sent in stderr: "PHP message: PHP Warning: Use of undefined constant assets - assumed 'assets' (this will throw an Error in a future version of PHP) in /var/www/*******/includes/vb5/template.php(404) : eval()'d code on line 256
As long as it works I ignored that. But when I update PHP to version 8, the sub site is no longer available. Seems that warning occurs an error now.

In my code I cannot find any error. The problem seems to result in a loop of my (simplified) code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Don't really know, what php8 needs to work at this point. Has anyone an idea?
Reply With Quote
  #2  
Old 28 Oct 2021, 15:26
shka shka is offline
 
Join Date: Mar 2016
https://www.php.net/manual/de/migrat...compatible.php


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Deine Variablenbezeichnungen sind grausam nichtssagend (var, variables, variable, y, i). Welche davon kann den Wert 'assets' annehmen?

Your variables are cruelly named. Which of them can get the value 'assets'?
Reply With Quote
  #3  
Old 29 Oct 2021, 01:47
BulliM's Avatar
BulliM BulliM is offline
 
Join Date: Oct 2017
Thanks for that. Will check that.

Originally Posted by shka View Post
Your variables are cruelly named. Which of them can get the value 'assets'?
Seems not important, because any line like...

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

...in my code, results in this error.

Only if all those (five) lines excluded, my code is running. But probably these lines aren't the problem. At the moment I really don't know, what is going on.

--------------- Added 29 Oct 2021 at 02:55 ---------------

SOLVED

I've solved that. Error was in template.

This code...

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

...results in that error.

I solved that by doing...


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

...what works with PHP8. I have no errors anymore.
Reply With Quote
  #4  
Old 29 Oct 2021, 07:41
delicjous's Avatar
delicjous delicjous is offline
 
Join Date: Nov 2014
You could use $val['assets'] directly in your if condition.
__________________
ⓒ by delicjous
Reply With Quote
  #5  
Old 29 Oct 2021, 14:01
BulliM's Avatar
BulliM BulliM is offline
 
Join Date: Oct 2017
Originally Posted by delicjous View Post
You could use $val['assets'] directly in your if condition.
I tried yesterday, but this doesn't work.
Reply With Quote
  #6  
Old 30 Oct 2021, 05:10
delicjous's Avatar
delicjous delicjous is offline
 
Join Date: Nov 2014
Originally Posted by BulliM View Post
I tried yesterday, but this doesn't work.
Dann weiß ich auch nicht…

Then shka is right and we need more input. But if it is working it is ok I think
__________________
ⓒ by delicjous
Reply With Quote
Reply


Tags
error, php7, php8, variable


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 23:29.

Layout Options | Width: Wide Color: