3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = array(1,3,2); foreach ($arr as $key => $value) { $data = [ 'table' => 'tbl_worker_exp', 'val'=>array( 'country_id'=>$value), 'where' => ['sub_id'=>2] ]; show($data); } function show($arr){ echo "UPDATE ".$arr['table']." SET country_id=".$arr['val']['country_id']." WHERE sub_id= ".$arr['where']['sub_id']; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/WrrpT
function name:  (null)
number of ops:  15
compiled vars:  !0 = $arr, !1 = $value, !2 = $key, !3 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $5      !0, ->13
          2    > > FE_FETCH_R                                       ~6      $5, !1, ->13
          3    >   ASSIGN                                                   !2, ~6
    7     4        INIT_ARRAY                                       ~8      'tbl_worker_exp', 'table'
    9     5        INIT_ARRAY                                       ~9      !1, 'country_id'
          6        ADD_ARRAY_ELEMENT                                ~8      ~9, 'val'
    7     7        ADD_ARRAY_ELEMENT                                ~8      <array>, 'where'
    6     8        ASSIGN                                                   !3, ~8
   12     9        INIT_FCALL_BY_NAME                                       'show'
         10        SEND_VAR_EX                                              !3
         11        DO_FCALL                                      0          
    5    12      > JMP                                                      ->2
         13    >   FE_FREE                                                  $5
   18    14      > RETURN                                                   1

Function show:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WrrpT
function name:  show
number of ops:  13
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        FETCH_DIM_R                                      ~1      !0, 'table'
          2        CONCAT                                           ~2      'UPDATE+', ~1
          3        CONCAT                                           ~3      ~2, '+SET+country_id%3D'
          4        FETCH_DIM_R                                      ~4      !0, 'val'
          5        FETCH_DIM_R                                      ~5      ~4, 'country_id'
          6        CONCAT                                           ~6      ~3, ~5
          7        CONCAT                                           ~7      ~6, '+WHERE+sub_id%3D+'
          8        FETCH_DIM_R                                      ~8      !0, 'where'
          9        FETCH_DIM_R                                      ~9      ~8, 'sub_id'
         10        CONCAT                                           ~10     ~7, ~9
         11        ECHO                                                     ~10
   18    12      > RETURN                                                   null

End of function show

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.57 ms | 3307 KiB | 13 Q