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"; sleep(60); socket_close($socket); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
2 jumps found. (Code = 47) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 35
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 18
filename:       /in/VCSqf
function name:  (null)
number of ops:  42
compiled vars:  !0 = $address, !1 = $port, !2 = $socket, !3 = $client
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '127.0.0.1'
    3     1        ASSIGN                                                   !1, 9875
    4     2        ECHO                                                     'I+am+here'
    5     3        INIT_FCALL                                               'set_time_limit'
          4        SEND_VAL                                                 0
          5        DO_ICALL                                                 
    6     6        INIT_FCALL_BY_NAME                                       'socket_create'
          7        FETCH_CONSTANT                                   ~7      'AF_INET'
          8        SEND_VAL_EX                                              ~7
          9        FETCH_CONSTANT                                   ~8      'SOCK_STREAM'
         10        SEND_VAL_EX                                              ~8
         11        FETCH_CONSTANT                                   ~9      'SOL_TCP'
         12        SEND_VAL_EX                                              ~9
         13        DO_FCALL                                      0  $10     
         14        ASSIGN                                           ~11     !2, $10
         15        BOOL_NOT                                         ~12     ~11
         16      > JMPZ                                                     ~12, ->18
    8    17    >   ECHO                                                     'could+not+create+socket'
   10    18    >   INIT_FCALL_BY_NAME                                       'socket_bind'
         19        SEND_VAR_EX                                              !2
         20        SEND_VAR_EX                                              !0
         21        SEND_VAR_EX                                              !1
         22        DO_FCALL                                      0  $13     
         23      > JMPNZ_EX                                         ~14     $13, ->26
         24    > > EXIT                                                     'could+not+bind+socket'
         25*       BOOL                                             ~14     <true>
   11    26    >   INIT_FCALL_BY_NAME                                       'socket_listen'
         27        SEND_VAR_EX                                              !2
         28        DO_FCALL                                      0          
   12    29        INIT_FCALL_BY_NAME                                       'socket_accept'
         30        SEND_VAR_EX                                              !2
         31        DO_FCALL                                      0  $16     
         32        ASSIGN                                           ~17     !3, $16
         33      > JMPZ                                                     ~17, ->35
   13    34    >   ECHO                                                     'client+is+here'
   14    35    >   INIT_FCALL                                               'sleep'
         36        SEND_VAL                                                 60
         37        DO_ICALL                                                 
   15    38        INIT_FCALL_BY_NAME                                       'socket_close'
         39        SEND_VAR_EX                                              !2
         40        DO_FCALL                                      0          
   16    41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.79 ms | 1400 KiB | 17 Q