3v4l.org

run code in 300+ PHP versions simultaneously
<?php $address="127.0.0.1"; $port=9875; echo "I am here"; set_time_limit (0); if(false==($socket= socket_create(AF_INET,SOCK_STREAM, SOL_TCP))) { echo "could not create socket"; } socket_bind($socket, $address, $port) or die ("could not bind socket"); socket_listen($socket); if(($client=socket_accept($socket))) echo "client is here"; socket_close($socket); ?>
Output for 7.0.16 - 7.0.31, 7.1.2 - 7.1.22, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.3 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
I am here Fatal error: Uncaught Error: Call to undefined function socket_create() in /in/r1JqK:6 Stack trace: #0 {main} thrown in /in/r1JqK on line 6
Process exited with code 255.
Output for 5.6.31 - 5.6.38
I am here Fatal error: Call to undefined function socket_create() in /in/r1JqK on line 6
Process exited with code 255.

preferences:
185.6 ms | 401 KiB | 196 Q