You're right, this should be `if ($data === null || is_array($data) || is_scalar($data))`.