note 125240 added to language.types.integer

From: Date: Mon, 03 Aug 2020 13:02:38 +0000
Subject: note 125240 added to language.types.integer
Groups: php.notes 
Request: Send a blank email to php-notes+get-214923@lists.php.net to get a copy of this message
Integer literals may be decimal, octal, hexadecimal or binary, but integer values have single representation; <?php var_dump(010); // int(8) NOT int(010) var_dump(0x10); // int(16) NOT int(0x10) var_dump(0b10); // int(2) NOT int(0b10) ?> This is the reason why casting integer to string gives us always a decimal: <?php var_dump((string) 010); // string(8) NOT string(010) var_dump((string) 0x10); // string(16) NOT string(0x10) var_dump((string) 0b10); // string(2) NOT string(0b10) ?> ---- Server IP: 45.112.84.4 Probable Submitter: 103.51.166.36 (proxied: 185.234.210.189) ---- Manual Page -- http://php.net/manual/en/language.types.integer.php Edit -- https://master.php.net/note/edit/125240 Del: integrated -- https://master.php.net/note/delete/125240/integrated Del: useless -- https://master.php.net/note/delete/125240/useless Del: bad code -- https://master.php.net/note/delete/125240/bad+code Del: spam -- https://master.php.net/note/delete/125240/spam Del: non-english -- https://master.php.net/note/delete/125240/non-english Del: in docs -- https://master.php.net/note/delete/125240/in+docs Del: other reasons-- https://master.php.net/note/delete/125240 Reject -- https://master.php.net/note/reject/125240 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214923) next »