3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'Hello World'; $socket= socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); socket_set_option($socket, SOL_SOCKET, MCAST_JOIN_SOURCE_GROUP, array("group"=>"239.194.0.73","interface"=>"eth0","source"=>"239.194.0.73")); $binded = socket_bind($socket, '0.0.0.1', 6073); //receive data $from = '192.168.0.1'; $port = 4824; socket_recvfrom($socket, $buf, 12, MSG_WAITALL, $from, $port); echo "Received $buf from remote address $from and remote port $port" . PHP_EOL; ?> <?php echo 'Hello World'; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tHJRH
function name:  (null)
number of ops:  45
compiled vars:  !0 = $socket, !1 = $binded, !2 = $from, !3 = $port, !4 = $buf
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     'Hello+World'
    7     1        INIT_FCALL_BY_NAME                                       'socket_create'
          2        FETCH_CONSTANT                                   ~5      'AF_INET'
          3        SEND_VAL_EX                                              ~5
          4        FETCH_CONSTANT                                   ~6      'SOCK_DGRAM'
          5        SEND_VAL_EX                                              ~6
          6        FETCH_CONSTANT                                   ~7      'SOL_UDP'
          7        SEND_VAL_EX                                              ~7
          8        DO_FCALL                                      0  $8      
          9        ASSIGN                                                   !0, $8
    8    10        INIT_FCALL_BY_NAME                                       'socket_set_option'
         11        SEND_VAR_EX                                              !0
         12        FETCH_CONSTANT                                   ~10     'SOL_SOCKET'
         13        SEND_VAL_EX                                              ~10
         14        FETCH_CONSTANT                                   ~11     'MCAST_JOIN_SOURCE_GROUP'
         15        SEND_VAL_EX                                              ~11
         16        SEND_VAL_EX                                              <array>
         17        DO_FCALL                                      0          
    9    18        INIT_FCALL_BY_NAME                                       'socket_bind'
         19        SEND_VAR_EX                                              !0
         20        SEND_VAL_EX                                              '0.0.0.1'
         21        SEND_VAL_EX                                              6073
         22        DO_FCALL                                      0  $13     
         23        ASSIGN                                                   !1, $13
   15    24        ASSIGN                                                   !2, '192.168.0.1'
   16    25        ASSIGN                                                   !3, 4824
   17    26        INIT_FCALL_BY_NAME                                       'socket_recvfrom'
         27        SEND_VAR_EX                                              !0
         28        SEND_VAR_EX                                              !4
         29        SEND_VAL_EX                                              12
         30        FETCH_CONSTANT                                   ~17     'MSG_WAITALL'
         31        SEND_VAL_EX                                              ~17
         32        SEND_VAR_EX                                              !2
         33        SEND_VAR_EX                                              !3
         34        DO_FCALL                                      0          
   18    35        ROPE_INIT                                     6  ~20     'Received+'
         36        ROPE_ADD                                      1  ~20     ~20, !4
         37        ROPE_ADD                                      2  ~20     ~20, '+from+remote+address+'
         38        ROPE_ADD                                      3  ~20     ~20, !2
         39        ROPE_ADD                                      4  ~20     ~20, '+and+remote+port+'
         40        ROPE_END                                      5  ~19     ~20, !3
         41        CONCAT                                           ~23     ~19, '%0A'
         42        ECHO                                                     ~23
   22    43        ECHO                                                     'Hello+World'
   24    44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.8 ms | 1399 KiB | 13 Q