note 22008 added to language.types.string

From: Date: Mon, 03 Jun 2002 18:58:30 +0000
Subject: note 22008 added to language.types.string
Groups: php.notes 
Request: Send a blank email to php-notes+get-31390@lists.php.net to get a copy of this message
//Some more useful examples (and some that are only interesting): $foo = 1 + "010"; //$foo is 11, not 9 - i.e. PHP doesn't recognize 010 as octal. $foo = 1 + "0x10"; //$foo is 17 - i.e. PHP DOES recognize 0x10 as hex for 16. $foo = 1 + "\x10"; $bar = 1 + "\x35"; //0x35 is ASCII for '5' //$foo is 1, but $bar is 6. $foo = 1 + "0x\x41\x31"; //0x41 is ASCII 'A'; 0x31 is '1' //$foo is 162: 1 + 0xA1 = 1 + 161. /*NOTE: These examples were "discovered" using PHP4, Apache2, Red Hat 7.2*/ -- http://www.php.net/manual/en/language.types.string.php http://master.php.net/manage/user-notes.php?action=edit+22008 http://master.php.net/manage/user-notes.php?action=delete+22008 http://master.php.net/manage/user-notes.php?action=reject+22008

« previous php.notes (#31390) next »