3v4l.org

run code in 300+ 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 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 11
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 30
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 30
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 11
Branch analysis from position: 34
Branch analysis from position: 11
Branch analysis from position: 30
Branch analysis from position: 30
filename:       /in/IhVkR
function name:  (null)
number of ops:  38
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                                                      ->31
    7    11    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~10     !1, !2
         12        BOOL_NOT                                         ~11     ~10
         13      > JMPZ                                                     ~11, ->30
    8    14    >   INIT_FCALL                                               'strpos'
         15        FETCH_DIM_R                                      ~12     !1, !2
         16        SEND_VAL                                                 ~12
         17        SEND_VAL                                                 '-T'
         18        DO_ICALL                                         $13     
         19        TYPE_CHECK                                  1018          $13
         20      > JMPZ                                                     ~14, ->30
    9    21    >   INIT_FCALL                                               'explode'
         22        SEND_VAL                                                 '-'
         23        FETCH_DIM_R                                      ~15     !1, !2
         24        SEND_VAL                                                 ~15
         25        DO_ICALL                                         $16     
         26        ASSIGN                                                   !3, $16
   10    27        FETCH_DIM_R                                      ~19     !3, 0
         28        ASSIGN_DIM                                               !4
         29        OP_DATA                                                  ~19
    6    30    >   PRE_INC                                                  !2
         31    >   COUNT                                            ~21     !1
         32        IS_SMALLER_OR_EQUAL                                      !2, ~21
         33      > JMPNZ                                                    ~22, ->11
   14    34    >   INIT_FCALL                                               'print_r'
         35        SEND_VAR                                                 !4
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.96 ms | 1017 KiB | 16 Q