Binary Not Operator¶
The tilde ~ operator return the opposite value, bit by by. The value is first converted to an integer, then, negated. This operator returns an integer.
~ is often confused with !, as some usage quite overlap.
<?php
$a = 3; // 3
$b = ~$a; // -4
$c = !$a; // false
?>
Related : Not Operator, ~ Tilde