title: Cloning only the value of a variable
body: <p>Im trying to make some kind of ambience randomizer, which picks a random ambience at every page load, but I also want it to avoid picking the same one from the previous page.</p>
  
  <pre><code>$amblst = array(1,2,3,4,5,6,7,8,9,10);
  
  if (($key = array_search($_SESSION['ambprev'], $amblst)) !== false) {
      unset($array[$key]);
  }
  
  $ambnum = $ambnum + 1;
  $ambnum = array_rand($amblst);
  
  $_SESSION['ambprev'] = clone $ambnum;
  </code></pre>
  
  <p>However using clone breaks the page for some reason and I don't have access to the error logs, so I can't provide that right now.</p>
  
  <p>I just want to clone the variable's value, nothing more.</p>