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