xref: /PHP-7.3/Zend/tests/xor_002.phpt (revision 782352c5)
1--TEST--
2XORing strings
3--FILE--
4<?php
5
6$s = "123";
7$s1 = "234";
8var_dump(bin2hex($s ^ $s1));
9
10$s = "1235";
11$s1 = "234";
12var_dump(bin2hex($s ^ $s1));
13
14$s = "some";
15$s1 = "test";
16var_dump(bin2hex($s ^ $s1));
17
18$s = "some long";
19$s1 = "test";
20var_dump(bin2hex($s ^ $s1));
21
22$s = "some";
23$s1 = "test long";
24var_dump(bin2hex($s ^ $s1));
25
26$s = "some";
27$s ^= "test long";
28var_dump(bin2hex($s));
29
30echo "Done\n";
31?>
32--EXPECT--
33string(6) "030107"
34string(6) "030107"
35string(8) "070a1e11"
36string(8) "070a1e11"
37string(8) "070a1e11"
38string(8) "070a1e11"
39Done
40