Why does:
//echo -a $onpoly( 2 , 2 , 100 ,100 ,200 , 100 , 150 , 50 , 150 , 150 )
return $false ?

A line is also a polygon. And the 2 lines are crossing each other.

Is this a Bug or did i do anything wrong?

If the $onploly can't check if 2 lines are crossing how can i check this then (in one line without a while loop or long calculations)