3v4l.org

run code in 500+ PHP versions simultaneously
<?php $variantsData = range(1,5); // Loop to find each variants ID foreach ($variantsData as $variantData) { $variant[] = array('id'=> rand(1,4)); // see this line //^^ } print_r($variant[0]['id']); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/Wf9TE
function name:  (null)
number of ops:  22
compiled vars:  !0 = $variantsData, !1 = $variantData, !2 = $variant
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'range'
          1        SEND_VAL                                                     1
          2        SEND_VAL                                                     5
          3        DO_ICALL                                             $3      
          4        ASSIGN                                                       !0, $3
    4     5      > FE_RESET_R                                           $5      !0, ->15
          6    > > FE_FETCH_R                                                   $5, !1, ->15
    5     7    >   INIT_FCALL                                                   'rand'
          8        SEND_VAL                                                     1
          9        SEND_VAL                                                     4
         10        DO_ICALL                                             $7      
         11        INIT_ARRAY                                           ~8      $7, 'id'
         12        ASSIGN_DIM                                                   !2
         13        OP_DATA                                                      ~8
    4    14      > JMP                                                          ->6
         15    >   FE_FREE                                                      $5
    9    16        INIT_FCALL                                                   'print_r'
         17        FETCH_DIM_R                                          ~9      !2, 0
         18        FETCH_DIM_R                                          ~10     ~9, 'id'
         19        SEND_VAL                                                     ~10
         20        DO_ICALL                                                     
   11    21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.26 ms | 1232 KiB | 16 Q