note 40358 added to language.operators.bitwise

From: Date: Mon, 01 Mar 2004 09:35:19 +0000
Subject: note 40358 added to language.operators.bitwise
Groups: php.notes 
Request: Send a blank email to php-notes+get-66026@lists.php.net to get a copy of this message
Curiously... <?php $a = ~ 1; // not 1 $b = ~ 0; // not 0 echo "not 1 equals $a"; // =-2 echo "not 0 equals $b"; // =-1 ?> You need to add 2 to $a and $b to make (not 1) = 0 and (not 0) = 1 ---- Manual Page -- http://www.php.net/manual/en/language.operators.bitwise.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40358 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40358&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40358&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#66026) next »