3v4l.org

run code in 300+ PHP versions simultaneously
<?php $server = stream_socket_server('tcp://127.0.0.1:8080'); $context = stream_context_create(array('socket'=>array('bindto'=>'1.2.3.4:5678'))); $client = stream_socket_client('tcp://127.0.0.1:8080', $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $context); var_dump($client); var_dump(stream_socket_get_name($client, false));

preferences:
15.66 ms | 462 KiB | 5 Q