Your code has a bug on line 2.
@file_get_contents('http://.long2ip(ip2long($argv[1])+$c)
Since $c is the IP address itself, adding the starting IP again will check a completely different IP.
Besides that, you have a point. I feel like the code would be so much cleaner if they just added a 4th line to declare ip2long($argv[1]) as a variable.