note 64984 added to language.types.type-juggling

From: Date: Mon, 24 Apr 2006 08:02:06 +0000
Subject: note 64984 added to language.types.type-juggling
Groups: php.notes 
Request: Send a blank email to php-notes+get-109302@lists.php.net to get a copy of this message
Sorry, I am resubmitting this, as I needed to slightly fix my last submission: There seems to be a problem with string hexadecimals and type juggling. The following expectedly ignores the hexadecimal value since floats are only specifiable in decimal. <?php var_dump ((float) "0x31"); // (float)0 var_dump (1.5+(float)"0x31"); // (float)1.5 ?> However, the following seems to first convert the hexadecimal string to an integer (which does allow hexadecimals) and then to a float, rather than immediately converting to float, as the documentation here on type juggling would have it: <?php var_dump (1.5+"0x31"); // (float)50.5 (i.e., 1.5+49) ?> ---- Server IP: 66.163.161.117 Probable Submitter: 218.17.94.14 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/language.types.type-juggling.php Edit -- http://master.php.net/note/edit/64984 Del: integrated -- http://master.php.net/note/delete/64984/integrated Del: useless -- http://master.php.net/note/delete/64984/useless Del: bad code -- http://master.php.net/note/delete/64984/bad+code Del: spam -- http://master.php.net/note/delete/64984/spam Del: non-english -- http://master.php.net/note/delete/64984/non-english Del: in docs -- http://master.php.net/note/delete/64984/in+docs Del: other reasons-- http://master.php.net/note/delete/64984 Reject -- http://master.php.net/note/reject/64984 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#109302) next »