- Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
- array ( 'toxic' => 3, 'irritant' => 2, 'flammable' => 1, )
<?php
$array = [
['toxic', 'irritant', 'flammable'],
['toxic', 'irritant'],
['toxic'],
];
var_export(
array_count_values(
array_merge(...$array)
)
);