speed up php test code
add helper functions to CompareFlags to avoid dealing with native lists