If an array is created to set the key as the numeric value and the value of that key as the the text title, TINYINT will be replaced by CHAR value. But is this process is reversed, then the code will select TINYINT if the foreach statement set to break when the numeric value of the flag equals the value of the current key as the first intance.