Created
May 24, 2015 19:41
-
-
Save nopolabs/1023c2ee628752b94e37 to your computer and use it in GitHub Desktop.
dbgtest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// adapted from https://blogs.oracle.com/netbeansphp/entry/howto_check_xdebug_installation | |
$address = $argv[1] ?: '127.0.0.1'; | |
$port = '9000'; | |
$sock = socket_create(AF_INET, SOCK_STREAM, 0); | |
socket_bind($sock, $address, $port) or die(); | |
echo "Listening to $address:$port\n"; | |
socket_listen($sock); | |
$client = socket_accept($sock); | |
echo "Connection established: $client\n"; | |
socket_close($client); | |
socket_close($sock); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment