I've reproduced this. Nasty issue, actually.
This is caused by https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.pdo.mysql
DB driver in php8.1 returns integer and decimal number values from database as integers and floats. In previous php versions, the return values were simple strings.
So, sql query
SELECT * FROM tb_access WHERE id_tab = 1 AND id_profile = 2
used to return data
[
'view' => '1',
'add' => '1',
'delete' => '1',
'edid' => '1'
]
But in PHP8.1 it returns
[
'view' => 1,
'add' => 1,
'delete' => 1,
'edid' => 1
]
Couple this change with strict comparison operator:
if ($access['view'] === '1') {
// ...
}
And we have a huge problem.