3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<STRING 34 Item 5423 11Item 44 Item 3470 BLABLA TEF2200 STRING; $arr = array(); foreach (explode("\n", $data) as $row) { preg_match('/^(?<id>\d+)\s+(?<name>[\w ]+)$/', $row, $matches); $id = $matches['id']; $name = $matches['name']; if ($id > 1 && $id < 65366) { $arr[$id] = $name; } } print_r($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 25
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 25
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 24
Branch analysis from position: 21
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/hunbN
function name:  (null)
number of ops:  30
compiled vars:  !0 = $data, !1 = $arr, !2 = $row, !3 = $matches, !4 = $id, !5 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '34+Item%0A5423+11Item%0A44++++Item%0A3470++++BLABLA+TEF2200'
   10     1        ASSIGN                                                   !1, <array>
   11     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%0A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $8      
          6      > FE_RESET_R                                       $9      $8, ->25
          7    > > FE_FETCH_R                                               $9, !2, ->25
   12     8    >   INIT_FCALL                                               'preg_match'
          9        SEND_VAL                                                 '%2F%5E%28%3F%3Cid%3E%5Cd%2B%29%5Cs%2B%28%3F%3Cname%3E%5B%5Cw+%5D%2B%29%24%2F'
         10        SEND_VAR                                                 !2
         11        SEND_REF                                                 !3
         12        DO_ICALL                                                 
   14    13        FETCH_DIM_R                                      ~11     !3, 'id'
         14        ASSIGN                                                   !4, ~11
   15    15        FETCH_DIM_R                                      ~13     !3, 'name'
         16        ASSIGN                                                   !5, ~13
   17    17        IS_SMALLER                                       ~15     1, !4
         18      > JMPZ_EX                                          ~15     ~15, ->21
         19    >   IS_SMALLER                                       ~16     !4, 65366
         20        BOOL                                             ~15     ~16
         21    > > JMPZ                                                     ~15, ->24
   18    22    >   ASSIGN_DIM                                               !1, !4
         23        OP_DATA                                                  !5
   11    24    > > JMP                                                      ->7
         25    >   FE_FREE                                                  $9
   22    26        INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.38 ms | 1401 KiB | 19 Q