3v4l.org

run code in 500+ PHP versions simultaneously
<?php $t = '1-P,2-T,3-P,4-R,5-C,6-T,'; $data = explode(",", $t); print_r($data); for ($i = 0; $i <= count($data); $i++) { if (!empty($data[$i])) { if (strpos($data[$i], '-T') !== false) { $final = explode("-", $data[$i]); $row[]=$final[0]; } } } print_r($row);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 11
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 27
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 27
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 11
Branch analysis from position: 31
Branch analysis from position: 11
Branch analysis from position: 27
Branch analysis from position: 27
filename:       /in/IhVkR
function name:  (null)
number of ops:  35
compiled vars:  !0 = $t, !1 = $data, !2 = $i, !3 = $final, !4 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '1-P%2C2-T%2C3-P%2C4-R%2C5-C%2C6-T%2C'
    4     1        INIT_FCALL                                                   'explode'
          2        SEND_VAL                                                     '%2C'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $6      
          5        ASSIGN                                                       !1, $6
    5     6        INIT_FCALL                                                   'print_r'
          7        SEND_VAR                                                     !1
          8        DO_ICALL                                                     
    6     9        ASSIGN                                                       !2, 0
         10      > JMP                                                          ->28
    7    11    >   ISSET_ISEMPTY_DIM_OBJ                             1  ~10     !1, !2
         12        BOOL_NOT                                             ~11     ~10
         13      > JMPZ                                                         ~11, ->27
    8    14    >   FETCH_DIM_R                                          ~12     !1, !2
         15        FRAMELESS_ICALL_2                strpos              ~13     ~12, '-T'
         16        TYPE_CHECK                                      1018          ~13
         17      > JMPZ                                                         ~14, ->27
    9    18    >   INIT_FCALL                                                   'explode'
         19        SEND_VAL                                                     '-'
         20        FETCH_DIM_R                                          ~15     !1, !2
         21        SEND_VAL                                                     ~15
         22        DO_ICALL                                             $16     
         23        ASSIGN                                                       !3, $16
   10    24        FETCH_DIM_R                                          ~19     !3, 0
         25        ASSIGN_DIM                                                   !4
         26        OP_DATA                                                      ~19
    6    27    >   PRE_INC                                                      !2
         28    >   COUNT                                                ~21     !1
         29        IS_SMALLER_OR_EQUAL                                          !2, ~21
         30      > JMPNZ                                                        ~22, ->11
   14    31    >   INIT_FCALL                                                   'print_r'
         32        SEND_VAR                                                     !4
         33        DO_ICALL                                                     
         34      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.96 ms | 2121 KiB | 15 Q