title: Settype integer changing the value in php
body: <p>I have a field in my database called <code>time</code>. It contains UNIX timestamp. However the data type is a string and in php the date function expects an integer.</p>
  
  <p>So i tried parsing the string to an integer but the value changes.</p>
  
  <pre><code>    $time = $value['time'];
      echo "Time string is $time&lt;br/&gt;";
  
      settype($time,'integer');
      echo "time intenger is".$time."&lt;br/&gt;";
  </code></pre>
  
  <p>This is the output i get </p>
  
  <blockquote>
    <p>Time string is 1499327190163</p>
    
    <p>time intenger is2147483647</p>
  </blockquote>
  
  <p>What am i doing wrong here? Or is there a better way to convert timestamp to a date? Thanks</p>
  
  <p>EDIT : I just read the manual on settype and it said Maximum value for "int" is PHP_INT_MAX. Perhaps this could be my issue, would it be alright to change this, or should there be any security related concern in changing the max integer value?</p>