Bitwise operation result, strange output behavior

It seems that my previous question was not seen, so a new question.

#dump1 var_dump('two identical strings' | 'two identical strings'); # mind the | // string(21) "two identical strings" #dump2 var_dump('two identical strings' ^ 'two identical strings'); # mind the ^ // string(21) "" 

Why #dump2 show that length == 21, but displays no / invisible characters?

In addition, when inserted into Notepad ++, there are no 21 characters in this line, well, in fact, not even one character, in contrast to this output from different operations with unequal lines. enter image description here
Those (DC3) , (DC4) , etc. Not displayed in the browser, but displayed in Notepad ++.

Oh, and in fact, what are these blackish meanings inside this line? I assume these are bit / assembler level values, but, huh, guess !== true .

Thanks in advance!

0
source share
1 answer

An XORing sequence of bytes with itself basically sets all bits to 0. So you have a long string of x00 bytes, which is a NUL that has no readable representation on the screen. Performing bitwise operations on any kind of string usually results in rather random bit sequences that cannot be displayed on the screen as readable characters. This random black stuff you see is Notepad ++ trying to refine the visualization of the byte sequence.

+6
source

All Articles