3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function __construct() { $item = $this->itemResolver(); $counter = 0; $thumbnails = []; $preview = []; foreach(iterator_to_array($item,true) as $field){ ++$counter; //if needed $thumbnails[] = $ImageThumbNailPath = sprintf('%s_thumbnail.jpg',$field->value); //$field->value should be same as $feth[0][0]; $preview[] = $previewImagePath = sprintf('%s_preview',$field->value); //same as $feth[0][0] +1; } } public function itemResolver(): \Generator { $stmt = mysqli_query($db_connect, "select pk_i_id from oc_t_item_resource ORDER by pk_i_id desc"); $records = mysqli_fetch_all($stmt); foreach($records as $record){ yield $record; } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vIPbM
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E > > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 30
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 30
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/vIPbM
function name:  __construct
number of ops:  32
compiled vars:  !0 = $item, !1 = $counter, !2 = $thumbnails, !3 = $preview, !4 = $field, !5 = $ImageThumbNailPath, !6 = $previewImagePath
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_METHOD_CALL                                         'itemResolver'
          1        DO_FCALL                                      0  $7      
          2        ASSIGN                                                   !0, $7
    8     3        ASSIGN                                                   !1, 0
    9     4        ASSIGN                                                   !2, <array>
   10     5        ASSIGN                                                   !3, <array>
   11     6        INIT_FCALL                                               'iterator_to_array'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $12     
         10      > FE_RESET_R                                       $13     $12, ->30
         11    > > FE_FETCH_R                                               $13, !4, ->30
   12    12    >   PRE_INC                                                  !1
   13    13        INIT_FCALL                                               'sprintf'
         14        SEND_VAL                                                 '%25s_thumbnail.jpg'
         15        FETCH_OBJ_R                                      ~16     !4, 'value'
         16        SEND_VAL                                                 ~16
         17        DO_ICALL                                         $17     
         18        ASSIGN                                           ~18     !5, $17
         19        ASSIGN_DIM                                               !2
         20        OP_DATA                                                  ~18
   14    21        INIT_FCALL                                               'sprintf'
         22        SEND_VAL                                                 '%25s_preview'
         23        FETCH_OBJ_R                                      ~20     !4, 'value'
         24        SEND_VAL                                                 ~20
         25        DO_ICALL                                         $21     
         26        ASSIGN                                           ~22     !6, $21
         27        ASSIGN_DIM                                               !3
         28        OP_DATA                                                  ~22
   11    29      > JMP                                                      ->11
         30    >   FE_FREE                                                  $13
   18    31      > RETURN                                                   null

End of function __construct

Function itemresolver:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 14
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 14
filename:       /in/vIPbM
function name:  itemResolver
number of ops:  16
compiled vars:  !0 = $stmt, !1 = $db_connect, !2 = $records, !3 = $record
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   GENERATOR_CREATE                                         
   22     1        INIT_FCALL_BY_NAME                                       'mysqli_query'
          2        SEND_VAR_EX                                              !1
          3        SEND_VAL_EX                                              'select+pk_i_id+from+oc_t_item_resource+ORDER+by+pk_i_id+desc'
          4        DO_FCALL                                      0  $4      
          5        ASSIGN                                                   !0, $4
   23     6        INIT_FCALL_BY_NAME                                       'mysqli_fetch_all'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $6      
          9        ASSIGN                                                   !2, $6
   25    10      > FE_RESET_R                                       $8      !2, ->14
         11    > > FE_FETCH_R                                               $8, !3, ->14
   26    12    >   YIELD                                                    !3
   25    13      > JMP                                                      ->11
         14    >   FE_FREE                                                  $8
   29    15      > GENERATOR_RETURN                                         

End of function itemresolver

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.47 ms | 1400 KiB | 17 Q