3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = ['users' => [ ['id' => 1, 'name' => 'Alice', 'active' => true], ['id' => 2, 'name' => 'Bob', 'active' => false], ]]; $filtered = []; foreach ($data['users'] as $key => $user) { if ($user['id'] % 2 === 0) { $filtered[$key] = ['id' => $user['id']]; } } var_export($filtered);
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
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/KXYnC
function name:  (null)
number of ops:  20
compiled vars:  !0 = $data, !1 = $filtered, !2 = $user, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   10     2        FETCH_DIM_R                                      ~6      !0, 'users'
          3      > FE_RESET_R                                       $7      ~6, ->15
          4    > > FE_FETCH_R                                       ~8      $7, !2, ->15
          5    >   ASSIGN                                                   !3, ~8
   11     6        FETCH_DIM_R                                      ~10     !2, 'id'
          7        MOD                                              ~11     ~10, 2
          8        IS_IDENTICAL                                             ~11, 0
          9      > JMPZ                                                     ~12, ->14
   12    10    >   FETCH_DIM_R                                      ~14     !2, 'id'
         11        INIT_ARRAY                                       ~15     ~14, 'id'
         12        ASSIGN_DIM                                               !1, !3
         13        OP_DATA                                                  ~15
   10    14    > > JMP                                                      ->4
         15    >   FE_FREE                                                  $7
   16    16        INIT_FCALL                                               'var_export'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.58 ms | 999 KiB | 14 Q