note 41212 added to function.intval

From: Date: Fri, 02 Apr 2004 17:51:14 +0000
Subject: note 41212 added to function.intval
Groups: php.notes 
Request: Send a blank email to php-notes+get-67529@lists.php.net to get a copy of this message
on the note above (or rather below) dated 5 Mar 2004: <?php $num = pi(); echo (int) $num * 10; // prints 30, not 31 ?> if you do it this way you do get 31: <?php $num = pi(); echo (int) ($num * 10); // prints 31, not 30 ?> :) So remember that parenthesis'eseseses (however the plural is spelled) are important if they are important to your result. ---- Manual Page -- http://www.php.net/manual/en/function.intval.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41212 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41212&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41212&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#67529) next »