3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "Deri Renk|kırmızı-siyah-beyaz-sarı-lacivert,kadife Renk|kırmızı-sarı"; $list = explode(",", $input); $list1 = []; foreach( $list as $item ) { list($key,$data) = explode("|", $item); $list1[$key] = explode("-", $data); } foreach ( $list1 as $heading=>$out ) { echo "<div><h1>$heading</h1><ul>\n"; echo "<li>".implode("</li><li>",$out)."</li>\n"; echo "</ul</div>\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 25
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 25
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 42
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 42
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
Branch analysis from position: 25
filename:       /in/uBVIS
function name:  (null)
number of ops:  44
compiled vars:  !0 = $input, !1 = $list, !2 = $list1, !3 = $item, !4 = $key, !5 = $data, !6 = $out, !7 = $heading
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Deri+Renk%7Ck%C4%B1rm%C4%B1z%C4%B1-siyah-beyaz-sar%C4%B1-lacivert%2Ckadife+Renk%7Ck%C4%B1rm%C4%B1z%C4%B1-sar%C4%B1'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $9      
          5        ASSIGN                                                   !1, $9
    5     6        ASSIGN                                                   !2, <array>
    6     7      > FE_RESET_R                                       $12     !1, ->25
          8    > > FE_FETCH_R                                               $12, !3, ->25
    7     9    >   INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '%7C'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $13     
         13        FETCH_LIST_R                                     $14     $13, 0
         14        ASSIGN                                                   !4, $14
         15        FETCH_LIST_R                                     $16     $13, 1
         16        ASSIGN                                                   !5, $16
         17        FREE                                                     $13
    8    18        INIT_FCALL                                               'explode'
         19        SEND_VAL                                                 '-'
         20        SEND_VAR                                                 !5
         21        DO_ICALL                                         $19     
         22        ASSIGN_DIM                                               !2, !4
         23        OP_DATA                                                  $19
    6    24      > JMP                                                      ->8
         25    >   FE_FREE                                                  $12
   11    26      > FE_RESET_R                                       $20     !2, ->42
         27    > > FE_FETCH_R                                       ~21     $20, !6, ->42
         28    >   ASSIGN                                                   !7, ~21
   12    29        ROPE_INIT                                     3  ~24     '%3Cdiv%3E%3Ch1%3E'
         30        ROPE_ADD                                      1  ~24     ~24, !7
         31        ROPE_END                                      2  ~23     ~24, '%3C%2Fh1%3E%3Cul%3E%0A'
         32        ECHO                                                     ~23
   13    33        INIT_FCALL                                               'implode'
         34        SEND_VAL                                                 '%3C%2Fli%3E%3Cli%3E'
         35        SEND_VAR                                                 !6
         36        DO_ICALL                                         $26     
         37        CONCAT                                           ~27     '%3Cli%3E', $26
         38        CONCAT                                           ~28     ~27, '%3C%2Fli%3E%0A'
         39        ECHO                                                     ~28
   14    40        ECHO                                                     '%3C%2Ful%3C%2Fdiv%3E%0A'
   11    41      > JMP                                                      ->27
         42    >   FE_FREE                                                  $20
   15    43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.94 ms | 1016 KiB | 15 Q