Skip to content

Instantly share code, notes, and snippets.

@nopolabs
Created May 24, 2015 19:41
Show Gist options
  • Save nopolabs/1023c2ee628752b94e37 to your computer and use it in GitHub Desktop.
Save nopolabs/1023c2ee628752b94e37 to your computer and use it in GitHub Desktop.
dbgtest.php
<?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