note 109621 added to language.operators.increment
| From: | hartmut@php.net | Date: | Thu, 02 Aug 2012 15:28:56 +0000 |
| Subject: | note 109621 added to language.operators.increment | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189861@lists.php.net to get a copy of this message | ||
Note that
$a="9D9"; var_dump(++$a); => string(3) "9E0"
but counting onwards from there
$a="9E0"; var_dump(++$a); => float(10)
this is due to "9E0" being interpreted as a string representation of the float constant
9E0 (or 9e0), and thus evalutes to 9 * 10^0 = 9 (in a float context)
----
Server IP: 87.106.1.137
Probable Submitter: 212.100.42.202
----
Manual Page -- http://www.php.net/manual/en/language.operators.increment.php
Edit -- https://master.php.net/note/edit/109621
Del: integrated -- https://master.php.net/note/delete/109621/integrated
Del: useless -- https://master.php.net/note/delete/109621/useless
Del: bad code -- https://master.php.net/note/delete/109621/bad+code
Del: spam -- https://master.php.net/note/delete/109621/spam
Del: non-english -- https://master.php.net/note/delete/109621/non-english
Del: in docs -- https://master.php.net/note/delete/109621/in+docs
Del: other reasons-- https://master.php.net/note/delete/109621
Reject -- https://master.php.net/note/reject/109621
Search -- https://master.php.net/manage/user-notes.php