if (a isin b)
checks if the string 'b' contains the substring 'a' at any position. 318 is not 'overlooked'.
$numeric = 1 or 2, which are sent when you first connect to an IRC server, will satisfy the condition too, so it matches more than it should.