3v4l.org

run code in 500+ PHP versions simultaneously
<?php $file = explode("\n", '<Amanda> Hi there, how are you? <Jack> Hi, im fine <Jack> see you later'); foreach($file as $line) { $data = explode(' ', trim($line)); $name = trim($data[0], '<>'); $counter[$name] = ($counter[$name] ?? 0) + count($data) - 1; } var_dump($counter);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 25
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 25
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/0bM6Y
function name:  (null)
number of ops:  30
compiled vars:  !0 = $file, !1 = $line, !2 = $data, !3 = $name, !4 = $counter
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'explode'
          1        SEND_VAL                                                     '%0A'
          2        SEND_VAL                                                     '%3CAmanda%3E+Hi+there%2C+how+are+you%3F%0A%3CJack%3E+Hi%2C+im+fine+%0A%3CJack%3E+see+you+later'
          3        DO_ICALL                                             $5      
          4        ASSIGN                                                       !0, $5
    7     5      > FE_RESET_R                                           $7      !0, ->25
          6    > > FE_FETCH_R                                                   $7, !1, ->25
    8     7    >   INIT_FCALL                                                   'explode'
          8        SEND_VAL                                                     '+'
          9        FRAMELESS_ICALL_1                trim                ~8      !1
         10        SEND_VAL                                                     ~8
         11        DO_ICALL                                             $9      
         12        ASSIGN                                                       !2, $9
    9    13        FETCH_DIM_R                                          ~11     !2, 0
         14        FRAMELESS_ICALL_2                trim                ~12     ~11, '%3C%3E'
         15        ASSIGN                                                       !3, ~12
   10    16        FETCH_DIM_IS                                         ~15     !4, !3
         17        COALESCE                                             ~16     ~15
         18        QM_ASSIGN                                            ~16     0
         19        COUNT                                                ~17     !2
         20        ADD                                                  ~18     ~16, ~17
         21        SUB                                                  ~19     ~18, 1
         22        ASSIGN_DIM                                                   !4, !3
         23        OP_DATA                                                      ~19
    7    24      > JMP                                                          ->6
         25    >   FE_FREE                                                      $7
   13    26        INIT_FCALL                                                   'var_dump'
         27        SEND_VAR                                                     !4
         28        DO_ICALL                                                     
         29      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.45 ms | 1720 KiB | 15 Q