you could flip the $nulls array and then do an isset check instead of in_array. if somebody has a larger array with many nulls, that will be faster.