3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['name' => 'Login', 'y' => '1'], ['name' => 'Printer', 'y' => '2'], ['name' => 'Monitor', 'y' => '0'], ['name' => 'Computer', 'y' => '0'], ['name' => 'Network', 'y' => '0'], ['name' => 'Lain Lain', 'y' => '0'] ]; $intArray = []; foreach ($array as $id => $item) { if (is_numeric($item['y'])) { $intArray[$id]['y'] = intval($item['y']); } } var_dump($intArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/ABDof
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array, !1 = $intArray, !2 = $item, !3 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, <array>
   13     2      > FE_RESET_R                                       $6      !0, ->16
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->16
          4    >   ASSIGN                                                   !3, ~7
   14     5        INIT_FCALL                                               'is_numeric'
          6        FETCH_DIM_R                                      ~9      !2, 'y'
          7        SEND_VAL                                                 ~9
          8        DO_ICALL                                         $10     
          9      > JMPZ                                                     $10, ->15
   15    10    >   FETCH_DIM_R                                      ~13     !2, 'y'
         11        CAST                                          4  ~14     ~13
         12        FETCH_DIM_W                                      $11     !1, !3
         13        ASSIGN_DIM                                               $11, 'y'
         14        OP_DATA                                                  ~14
   13    15    > > JMP                                                      ->3
         16    >   FE_FREE                                                  $6
   19    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.28 ms | 1395 KiB | 17 Q