The excption that occurs when the string "Superman is awesome!" is used occurs because strpos return a postion index of 0 when the 'needle' string starts at the first character in the 'haystack' string. Php will evaluate !0 as false. So what happens in the case of "Superman is awesome!" is php eveluates '(!strpos(strtolower($str), 'superman'))' as true triggering the exception.
The way to correct this is to explicitly check for the return valsue of strpos to see if it is the booloean value false. This will distquising the cases of strpos returning the boolean fasle and the interger 0 when evaluated by the if statement
Replace
if(!strpos(strtolower($str), 'superman')) {