slight detail: we use `null !== $value` everywhere.