What's with the weird for loop?
Why not just:
for ($c = ip2long($argv[1]); $c <= ip2long($argv[2]); $c++)
if (strpos(@file_get_contents('http://'.long2ip(ip2long($argv[1])+$c), false, stream_context_create(array('http’ => array('timeout’ => $argv[3])))), $argv[4]) !== false)
die('H4xed :D — '.long2ip($c));