I recently upgraded Ubuntu from 20.04 LTS to 22.04 LTS. I noticed that PHP was upgraded to the following version:
PHP 8.1.2-1ubuntu2.13 (cli) (built: Jun 28 2023 14:01:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2-1ubuntu2.13, Copyright (c), by Zend Technologies
My PHP application stopped working in this part:
public function __set($name, $value)
{
$this->$name = $value;
}
public function DisplayMenu($buttons)
{
echo "\t\t\t<nav>\n\t\t\t\t<ul>\n";
while (list($name, $url) = each($buttons)) {
$this->DisplayButton($name, $url);
}
echo "\t\t\t\t</ul>\n\t\t\t</nav>\n";
}
The accessor magic method stopped working after the upgrade from PHP 7.x to 8.x. What is the new way to use the equivalent in PHP 8.x? Thank you.