PHP 8 is almost 1 year old now, so I think it's time to think about an upgrade.
I won't help with adjusting the old templates from SAM 4.7.3 and older, but if you already upgraded to SAM 2018.3, updating the templates is an easy fix.
Basically the only thing remaining to be changed is the use of while(list($x,$y) = each($z)).
That was never a great style to use, but it was legal until PHP 7.2 and was still tolerated in PHP 7.3/7.4, but you did get a deprecation warning in those versions.
It looks like the code for SAM's PHP template was written by 2 different persons, one who knew PHP and one who had no clue what they were doing and just copied a tutorial from PHP3 or even older (that technique was outdated already when SAM was released 20 years ago and even more so when they released their rebranded templates 10 years ago)
The fix is replacing all occurences of the above pattern (variable names will vary slightly throughout the code) with foreach($z as $x => $y).
Usually these are accompanied with a reset($z) in front.
There's one in code/code.playlist.php, one in code/classes/class.song.php and several in library\Common\form.php and library\Common\xml.php:
Without replacing these, the templates will not be able to start a database connection and show an error message.
If you forget to fix the files in /code, the search function won't work, but it should be fine otherwise.
Attached is a zip file containing an updated samPHPweb folder with the PHP8 compatible templates. I removed the config folder, so if you didn't make any changes to the templates themselves, you should be able to unzip this file on top of your PHP files without having to change anything. (your database and other config will remain untouched)
File comment: samPHPweb updated for PHP8, Overwrite your own files, does not include the config directory!!!
sam-php-8.zip [281.58 KiB]
Downloaded 161 times