3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.62 ms | 999 KiB | 15 Q