- var_dump: documentation ( source)
- array_filter: documentation ( source)
<?php
$attributes = [
'pinned' => $pinned,
'fullTextEnabled' => $fullTextEnabled,
'updateMode' => $updateMode
];
$diff = array_filter($attributes, function ($value) {
return $value !== null;
});
var_dump($diff);