Php Check If Array Of Objects Sort