3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mesg_key = ftok(__FILE__, 'm'); $mesg_id = msg_get_queue($mesg_key, 0666); function fetchMessage($mesg_id){ if(!is_resource($mesg_id)){ print_r("Mesg Queue is not Ready"); } if(msg_receive($mesg_id, 0, $mesg_type, 1024, $mesg, false, MSG_IPC_NOWAIT)){ print_r("Process got a new incoming MSG: $mesg "); } } register_tick_function("fetchMessage", $mesg_id); declare(ticks=2){ $i = 0; while(++$i < 100){ if($i%5 == 0){ msg_send($mesg_id, 1, "Hi: Now Index is :". $i); } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 17
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 27
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 17
Branch analysis from position: 30
Branch analysis from position: 17
Branch analysis from position: 27
filename:       /in/18raY
function name:  (null)
number of ops:  32
compiled vars:  !0 = $mesg_key, !1 = $mesg_id, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'ftok'
          1        SEND_VAL                                                 '%2Fin%2F18raY'
          2        SEND_VAL                                                 'm'
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    3     5        INIT_FCALL_BY_NAME                                       'msg_get_queue'
          6        SEND_VAR_EX                                              !0
          7        SEND_VAL_EX                                              438
          8        DO_FCALL                                      0  $5      
          9        ASSIGN                                                   !1, $5
   21    10        INIT_FCALL                                               'register_tick_function'
         11        SEND_VAL                                                 'fetchMessage'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
   25    14        ASSIGN                                                   !2, 0
         15        TICKS                                                    
   27    16      > JMP                                                      ->27
   29    17    >   MOD                                              ~9      !2, 5
         18        IS_EQUAL                                                 ~9, 0
         19      > JMPZ                                                     ~10, ->27
   31    20    >   INIT_FCALL_BY_NAME                                       'msg_send'
         21        SEND_VAR_EX                                              !1
         22        SEND_VAL_EX                                              1
         23        CONCAT                                           ~11     'Hi%3A+Now+Index+is+%3A', !2
         24        SEND_VAL_EX                                              ~11
         25        DO_FCALL                                      0          
         26        TICKS                                                    
   27    27    >   PRE_INC                                          ~13     !2
         28        IS_SMALLER                                               ~13, 100
         29      > JMPNZ                                                    ~14, ->17
         30    >   TICKS                                                    
   34    31      > RETURN                                                   1

Function fetchmessage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
Branch analysis from position: 7
filename:       /in/18raY
function name:  fetchMessage
number of ops:  25
compiled vars:  !0 = $mesg_id, !1 = $mesg_type, !2 = $mesg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        TYPE_CHECK                                  512  ~3      !0
          2        BOOL_NOT                                         ~4      ~3
          3      > JMPZ                                                     ~4, ->7
    9     4    >   INIT_FCALL                                               'print_r'
          5        SEND_VAL                                                 'Mesg+Queue+is+not+Ready'
          6        DO_ICALL                                                 
   13     7    >   INIT_FCALL_BY_NAME                                       'msg_receive'
          8        SEND_VAR_EX                                              !0
          9        SEND_VAL_EX                                              0
         10        SEND_VAR_EX                                              !1
         11        SEND_VAL_EX                                              1024
         12        SEND_VAR_EX                                              !2
         13        SEND_VAL_EX                                              <false>
         14        FETCH_CONSTANT                                   ~6      'MSG_IPC_NOWAIT'
         15        SEND_VAL_EX                                              ~6
         16        DO_FCALL                                      0  $7      
         17      > JMPZ                                                     $7, ->24
   15    18    >   INIT_FCALL                                               'print_r'
         19        ROPE_INIT                                     3  ~9      'Process+got+a+new+incoming+MSG%3A+'
         20        ROPE_ADD                                      1  ~9      ~9, !2
         21        ROPE_END                                      2  ~8      ~9, '+'
         22        SEND_VAL                                                 ~8
         23        DO_ICALL                                                 
   19    24    > > RETURN                                                   null

End of function fetchmessage

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.26 ms | 1400 KiB | 19 Q