fork(2) download
  1. <?php function is_64bit() {
  2. $int = "9223372036854775807";
  3. $int = intval($int);
  4. if ($int == 9223372036854775807) {
  5. /* 64bit */
  6. return true;
  7. }
  8. elseif ($int == 2147483647) {
  9. /* 32bit */
  10. return false;
  11. }
  12. else {
  13. /* error */
  14. return "error";
  15. } }
  16.  
  17. if(is_64bit() === true) echo 'This version of PHP is 64bit!';
  18. elseif(is_64bit() == "error") echo 'There was an unexpected error with the script.';
  19. else echo 'This version of PHP is 32bit...';
  20. ?>
Success #stdin #stdout 0s 13112KB
stdin
Standard input is empty
stdout
This version of PHP is 32bit...