3v4l.org

run code in 500+ PHP versions simultaneously
<?php $json = new stdClass; $json->status = 0; $json->msg='success'; for($i=0;$i<7;$i++){ $json->content[] = (object)[ 'shopId'=> rand(1,100),'shopname' => 'SP'.rand(1,10), 'shopcode' => rand(1,4999), 'type' => 'shop','flag' => rand(0,1)]; } print_r($json); foreach($json->content as $key=>$row){ echo "shopname = $row->shopname and shopcode = $row->shopcode". PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 9
Branch analysis from position: 38
2 jumps found. (Code = 77) Position 1 = 43, Position 2 = 54
Branch analysis from position: 43
2 jumps found. (Code = 78) Position 1 = 44, Position 2 = 54
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 9
Branch analysis from position: 38
Branch analysis from position: 9
filename:       /in/tWqt7
function name:  (null)
number of ops:  56
compiled vars:  !0 = $json, !1 = $i, !2 = $row, !3 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   NEW                                                  $4      'stdClass'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $4
    3     3        ASSIGN_OBJ                                                   !0, 'status'
          4        OP_DATA                                                      0
    4     5        ASSIGN_OBJ                                                   !0, 'msg'
          6        OP_DATA                                                      'success'
    5     7        ASSIGN                                                       !1, 0
          8      > JMP                                                          ->36
    7     9    >   INIT_FCALL                                                   'rand'
         10        SEND_VAL                                                     1
         11        SEND_VAL                                                     100
         12        DO_ICALL                                             $12     
         13        INIT_ARRAY                                           ~13     $12, 'shopId'
         14        INIT_FCALL                                                   'rand'
         15        SEND_VAL                                                     1
         16        SEND_VAL                                                     10
         17        DO_ICALL                                             $14     
         18        CONCAT                                               ~15     'SP', $14
         19        ADD_ARRAY_ELEMENT                                    ~13     ~15, 'shopname'
         20        INIT_FCALL                                                   'rand'
         21        SEND_VAL                                                     1
         22        SEND_VAL                                                     4999
         23        DO_ICALL                                             $16     
         24        ADD_ARRAY_ELEMENT                                    ~13     $16, 'shopcode'
         25        ADD_ARRAY_ELEMENT                                    ~13     'shop', 'type'
         26        INIT_FCALL                                                   'rand'
         27        SEND_VAL                                                     0
         28        SEND_VAL                                                     1
         29        DO_ICALL                                             $17     
         30        ADD_ARRAY_ELEMENT                                    ~13     $17, 'flag'
         31        CAST                                              8  ~18     ~13
    6    32        FETCH_OBJ_W                                          $10     !0, 'content'
         33        ASSIGN_DIM                                                   $10
    7    34        OP_DATA                                                      ~18
    5    35        PRE_INC                                                      !1
         36    >   IS_SMALLER                                                   !1, 7
         37      > JMPNZ                                                        ~20, ->9
   10    38    >   INIT_FCALL                                                   'print_r'
         39        SEND_VAR                                                     !0
         40        DO_ICALL                                                     
   12    41        FETCH_OBJ_R                                          ~22     !0, 'content'
         42      > FE_RESET_R                                           $23     ~22, ->54
         43    > > FE_FETCH_R                                           ~24     $23, !2, ->54
         44    >   ASSIGN                                                       !3, ~24
   13    45        ROPE_INIT                                         4  ~29     'shopname+%3D+'
         46        FETCH_OBJ_R                                          ~26     !2, 'shopname'
         47        ROPE_ADD                                          1  ~29     ~29, ~26
         48        ROPE_ADD                                          2  ~29     ~29, '+and+shopcode+%3D+'
         49        FETCH_OBJ_R                                          ~27     !2, 'shopcode'
         50        ROPE_END                                          3  ~28     ~29, ~27
         51        CONCAT                                               ~31     ~28, '%0A'
         52        ECHO                                                         ~31
   12    53      > JMP                                                          ->43
         54    >   FE_FREE                                                      $23
   14    55      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.52 ms | 1370 KiB | 15 Q