note 22008 deleted from language.types.string by colder
| From: | colder@php.net | Date: | Tue, 17 Oct 2006 17:51:19 +0000 |
| Subject: | note 22008 deleted from language.types.string by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118626@lists.php.net to get a copy of this message | ||
Note Submitter:
----
//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*/