3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array1 = [ ["status" => NULL, "number" => "2355"], ["status" => "1", "number" => "1"], ["status" => "2", "number" => "1"], ["status" => "3", "number" => "1"], ["status" => "4", "number" => "1"], ["status" => "7", "number" => "1"] ]; $array2 = [ "Undelivered", "Sent", "Bounced", "Delivered", "Opened", "Clicked", "Logged In", "Completed", "Committed" ]; $result = []; foreach ($array1 as ['status' => $i, 'number' => $n]) { $result[$array2[(int) $i]] = $n; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/X6uA9
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array1, !1 = $array2, !2 = $result, !3 = $i, !4 = $n
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   12     1        ASSIGN                                                       !1, <array>
   24     2        ASSIGN                                                       !2, <array>
   25     3      > FE_RESET_R                                           $8      !0, ->15
          4    > > FE_FETCH_R                                                   $8, $9, ->15
          5    >   FETCH_LIST_R                                         $10     $9, 'status'
          6        ASSIGN                                                       !3, $10
          7        FETCH_LIST_R                                         $12     $9, 'number'
          8        ASSIGN                                                       !4, $12
          9        FREE                                                         $9
   26    10        CAST                                              4  ~14     !3
         11        FETCH_DIM_R                                          ~15     !1, ~14
         12        ASSIGN_DIM                                                   !2, ~15
         13        OP_DATA                                                      !4
   25    14      > JMP                                                          ->4
         15    >   FE_FREE                                                      $8
   28    16        INIT_FCALL                                                   'var_export'
         17        SEND_VAR                                                     !2
         18        DO_ICALL                                                     
         19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
154.91 ms | 1602 KiB | 14 Q