3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '@property \App\Models\Invitation[] $invitations @property \App\Models\Invitation[] $invitations @blogpost @blogpost @blogpost @blogpost'; $arr = explode("\n", $str); $temp = array(); Foreach($arr as &$item){ If(isset($temp[$item])){ $key = $item; $item .= $temp[$item]; $temp[$key] = $temp[$key]+1; }Else{ $temp[$item] = 2; } } Echo implode("\n",$arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/i1bCv
function name:  (null)
number of ops:  29
compiled vars:  !0 = $str, !1 = $arr, !2 = $temp, !3 = $item, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%40property+%5CApp%5CModels%5CInvitation%5B%5D+%24invitations%0A%40property+%5CApp%5CModels%5CInvitation%5B%5D+%24invitations%0A%40blogpost%0A%40blogpost%0A%40blogpost%0A%40blogpost'
   10     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%0A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   12     6        ASSIGN                                                   !2, <array>
   13     7      > FE_RESET_RW                                      $9      !1, ->22
          8    > > FE_FETCH_RW                                              $9, !3, ->22
   14     9    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, !3
         10      > JMPZ                                                     ~10, ->19
   15    11    >   ASSIGN                                                   !4, !3
   16    12        FETCH_DIM_R                                      ~12     !2, !3
         13        ASSIGN_OP                                     8          !3, ~12
   17    14        FETCH_DIM_R                                      ~15     !2, !4
         15        ADD                                              ~16     ~15, 1
         16        ASSIGN_DIM                                               !2, !4
         17        OP_DATA                                                  ~16
   14    18      > JMP                                                      ->21
   19    19    >   ASSIGN_DIM                                               !2, !3
         20        OP_DATA                                                  2
   13    21    > > JMP                                                      ->8
         22    >   FE_FREE                                                  $9
   22    23        INIT_FCALL                                               'implode'
         24        SEND_VAL                                                 '%0A'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                         $18     
         27        ECHO                                                     $18
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.12 ms | 1007 KiB | 15 Q