xref: /PHP-8.2/ext/sockets/tests/bug80723.phpt (revision 6600ad60)
1--TEST--
2Bug #80723: Different sockets compare as equal (regression in 8.0)
3--EXTENSIONS--
4sockets
5--FILE--
6<?php
7$socket_1 = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
8$socket_2 = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
9var_dump($socket_1 == $socket_1);
10var_dump($socket_2 == $socket_2);
11var_dump($socket_1 == $socket_2);
12
13$vector = array(1 => $socket_1, 2 => $socket_2);
14var_dump(array_search($socket_1, $vector));
15var_dump(array_search($socket_2, $vector));
16
17?>
18--EXPECT--
19bool(true)
20bool(true)
21bool(false)
22int(1)
23int(2)
24