3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = ["1st Desc","2nd Desc","3rd Desc"]; $arr2 =["100.10","10.50","39.99"]; $expected = []; foreach($arr1 as $k=>$v){ $expected[$k] = ['description'=>$v,'amount'=>$arr2[$k]]; } echo json_encode($expected,JSON_PRETTY_PRINT); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/6FVHe
function name:  (null)
number of ops:  19
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $expected, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, <array>
    7     3      > FE_RESET_R                                       $8      !0, ->12
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->12
          5    >   ASSIGN                                                   !4, ~9
    8     6        INIT_ARRAY                                       ~12     !3, 'description'
          7        FETCH_DIM_R                                      ~13     !1, !4
          8        ADD_ARRAY_ELEMENT                                ~12     ~13, 'amount'
          9        ASSIGN_DIM                                               !2, !4
         10        OP_DATA                                                  ~12
    7    11      > JMP                                                      ->4
         12    >   FE_FREE                                                  $8
   11    13        INIT_FCALL                                               'json_encode'
         14        SEND_VAR                                                 !2
         15        SEND_VAL                                                 128
         16        DO_ICALL                                         $14     
         17        ECHO                                                     $14
   12    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.38 ms | 997 KiB | 14 Q