3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keys = [1,2]; $items = []; foreach ($keys as $i => $key) { $item = null; if (!empty($item)) { $items[$i] = $item; } else { $items[$i] = null; } } $result = array(); if(!empty($items)){ print_r($items); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
Branch analysis from position: 15
filename:       /in/rAjMB
function name:  (null)
number of ops:  24
compiled vars:  !0 = $keys, !1 = $items, !2 = $key, !3 = $i, !4 = $item, !5 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    4     2      > FE_RESET_R                                       $8      !0, ->15
          3    > > FE_FETCH_R                                       ~9      $8, !2, ->15
          4    >   ASSIGN                                                   !3, ~9
    5     5        ASSIGN                                                   !4, null
    6     6        ISSET_ISEMPTY_CV                                 ~12     !4
          7        BOOL_NOT                                         ~13     ~12
          8      > JMPZ                                                     ~13, ->12
    7     9    >   ASSIGN_DIM                                               !1, !3
         10        OP_DATA                                                  !4
         11      > JMP                                                      ->14
    9    12    >   ASSIGN_DIM                                               !1, !3
         13        OP_DATA                                                  null
    4    14    > > JMP                                                      ->3
         15    >   FE_FREE                                                  $8
   13    16        ASSIGN                                                   !5, <array>
   14    17        ISSET_ISEMPTY_CV                                 ~17     !1
         18        BOOL_NOT                                         ~18     ~17
         19      > JMPZ                                                     ~18, ->23
   15    20    >   INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
   16    23    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.56 ms | 1396 KiB | 15 Q