note 65248 deleted from function.intval by cmb

From: Date: Sun, 16 Feb 2020 13:49:37 +0000
Subject: note 65248 deleted from function.intval by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-214144@lists.php.net to get a copy of this message
Note Submitter: ---- Operating on integers gives puzzling results--which don't seem to have to do with the number of bits... <?php echo intval(1e10); // -1 on my system; 1410065408 in the example echo intval(1e5); // 100000 (my own example: lower number--works all right) echo intval(4e9); // -294967296 ! (my own example: somewhere in the middle) echo intval(42000000); // 42000000 (as in the manual; reasonable) echo intval(420000000000000000000); // -1 on my system at least. 0 in the example // ...and yet still odder... echo intval(4200000000); // -94967296! (my own example: somewhere in between) ?>

« previous php.notes (#214144) next »