3v4l.org

run code in 300+ PHP versions simultaneously
<?php $authorId = array("1", "2"); $authorName = array("Juan Cruz", "Jose Rizal"); $authorSname = array("J. Cruz", "J. Rizal"); $res = []; foreach($authorId as $key => $value){ $res[] = [ 'author_id' => $value, 'author_name' => $authorName[$key], 'author_sname'=> $authorSname[$key] ]; } echo json_encode($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/8pY6u
function name:  (null)
number of ops:  21
compiled vars:  !0 = $authorId, !1 = $authorName, !2 = $authorSname, !3 = $res, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    6     3        ASSIGN                                                   !3, <array>
    7     4      > FE_RESET_R                                       $10     !0, ->15
          5    > > FE_FETCH_R                                       ~11     $10, !4, ->15
          6    >   ASSIGN                                                   !5, ~11
    9     7        INIT_ARRAY                                       ~14     !4, 'author_id'
   10     8        FETCH_DIM_R                                      ~15     !1, !5
          9        ADD_ARRAY_ELEMENT                                ~14     ~15, 'author_name'
   11    10        FETCH_DIM_R                                      ~16     !2, !5
         11        ADD_ARRAY_ELEMENT                                ~14     ~16, 'author_sname'
    8    12        ASSIGN_DIM                                               !3
   11    13        OP_DATA                                                  ~14
    7    14      > JMP                                                      ->5
         15    >   FE_FREE                                                  $10
   14    16        INIT_FCALL                                               'json_encode'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $17     
         19        ECHO                                                     $17
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.07 ms | 1000 KiB | 14 Q