Consider classifying properties

This seems super scary... if $idTuples is int[] this is hopefully not needed. I would suggest to loop over/ array_map $idTuples and cast each value to int or float.