title: Php rand vs Perl rand
body: <p>I am trying to port a piece of code from perl to php. The perl code snippet is part of akamai's video on demand link generation script. The script generates seed based on the location / URL of the video file (which will always be constant for a single URL). And then it is used in generating serial ID for stream (which is basically a random number between 1 and 2000 using the seed). Here is the perl code.<pre><code>$seed=6718;
  srand($seed);
  print(int(rand(1999)) + 1); // return 442 every time</code></pre> And the converted PHP code is:<pre><code>$seed=6718;
  srand($seed);
  echo(rand(0, 1999) + 1); //returns 155 every time
  </code></pre> Does php rand behaves differently than perl one?</p>