3v4l.org

run code in 300+ PHP versions simultaneously
<?php $A = [ 0 => (object) [ "kriteria_kode" => "C1", "kriteria_bobot" => "70" ], 1 => (object) [ "kriteria_kode" => "C2", "kriteria_bobot" => "30" ], ]; $B = [[5,4.7],[4.4,4.6],[4.8,4.4],[4.7,4.65],[4.3,4.8]]; foreach($B as $pair){ $C[] = ($pair[0]*$A[0]->kriteria_bobot)/100 + ($pair[1]*$A[1]->kriteria_bobot)/100; } print_r($C);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 22
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/oR1qI
function name:  (null)
number of ops:  27
compiled vars:  !0 = $A, !1 = $B, !2 = $pair, !3 = $C
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   CAST                                          8  ~4      <array>
          1        INIT_ARRAY                                       ~5      ~4, 0
    4     2        CAST                                          8  ~6      <array>
          3        ADD_ARRAY_ELEMENT                                ~5      ~6, 1
    3     4        ASSIGN                                                   !0, ~5
    6     5        ASSIGN                                                   !1, <array>
    8     6      > FE_RESET_R                                       $9      !1, ->22
          7    > > FE_FETCH_R                                               $9, !2, ->22
    9     8    >   FETCH_DIM_R                                      ~11     !2, 0
          9        FETCH_DIM_R                                      ~12     !0, 0
         10        FETCH_OBJ_R                                      ~13     ~12, 'kriteria_bobot'
         11        MUL                                              ~14     ~11, ~13
         12        DIV                                              ~15     ~14, 100
         13        FETCH_DIM_R                                      ~16     !2, 1
         14        FETCH_DIM_R                                      ~17     !0, 1
         15        FETCH_OBJ_R                                      ~18     ~17, 'kriteria_bobot'
         16        MUL                                              ~19     ~16, ~18
         17        DIV                                              ~20     ~19, 100
         18        ADD                                              ~21     ~15, ~20
         19        ASSIGN_DIM                                               !3
         20        OP_DATA                                                  ~21
    8    21      > JMP                                                      ->7
         22    >   FE_FREE                                                  $9
   12    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.29 ms | 1400 KiB | 15 Q