|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-26 15:58 UTC] tony2001@php.net
[2006-12-26 16:02 UTC] olafvdspek at gmail dot com
[2006-12-26 16:38 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 13:00:01 2025 UTC |
Description: ------------ The ~ operator doesn't appear to convert a string to an integer first, like most other operators do. This produces unexpected results of course. Reproduce code: --------------- $b = '0'; $b = ~$b; printf('%s - %s<br>', $b, ord($b)); $b = 0; $b = ~$b; printf('%s - %s<br>', $b, ord($b)); Expected result: ---------------- -1 - 45 -1 - 45 Actual result: -------------- ? - 207 -1 - 45