3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ["g41" => 1, "g44" => 2, "g53" => 3]; $list = [40, 41, 44, 46, 53]; foreach ($list as $v) { if (isset($a["g$v"])) { $result[$v] = $a["g$v"]; } else { $extra[$v] = null; } } var_export(array_replace($result ?? [], $extra ?? []));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/YcRap
function name:  (null)
number of ops:  30
compiled vars:  !0 = $a, !1 = $list, !2 = $v, !3 = $result, !4 = $extra
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    7     2      > FE_RESET_R                                       $7      !1, ->17
          3    > > FE_FETCH_R                                               $7, !2, ->17
    8     4    >   NOP                                                      
          5        FAST_CONCAT                                      ~8      'g', !2
          6        ISSET_ISEMPTY_DIM_OBJ                         0          !0, ~8
          7      > JMPZ                                                     ~9, ->14
    9     8    >   NOP                                                      
          9        FAST_CONCAT                                      ~11     'g', !2
         10        FETCH_DIM_R                                      ~12     !0, ~11
         11        ASSIGN_DIM                                               !3, !2
         12        OP_DATA                                                  ~12
    8    13      > JMP                                                      ->16
   11    14    >   ASSIGN_DIM                                               !4, !2
         15        OP_DATA                                                  null
    7    16    > > JMP                                                      ->3
         17    >   FE_FREE                                                  $7
   14    18        INIT_FCALL                                               'var_export'
         19        INIT_FCALL                                               'array_replace'
         20        COALESCE                                         ~14     !3
         21        QM_ASSIGN                                        ~14     <array>
         22        SEND_VAL                                                 ~14
         23        COALESCE                                         ~15     !4
         24        QM_ASSIGN                                        ~15     <array>
         25        SEND_VAL                                                 ~15
         26        DO_ICALL                                         $16     
         27        SEND_VAR                                                 $16
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.99 ms | 1000 KiB | 15 Q