3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 0 => [ 'label' => 'Monsieur', 'value' => '1', 'selected' => true ], 1 => [ 'label' => 'Madame', 'value' => '2' ] ]; $res = false; foreach($arr as $item){ isset($item['selected']) ? $res = true : ''; } var_dump($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/fYSNI
function name:  (null)
number of ops:  17
compiled vars:  !0 = $arr, !1 = $res, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, <false>
   15     2      > FE_RESET_R                                       $5      !0, ->12
          3    > > FE_FETCH_R                                               $5, !2, ->12
   16     4    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'selected'
          5      > JMPZ                                                     ~6, ->9
          6    >   ASSIGN                                           ~7      !1, <true>
          7        QM_ASSIGN                                        ~8      ~7
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~8      ''
         10    >   FREE                                                     ~8
   15    11      > JMP                                                      ->3
         12    >   FE_FREE                                                  $5
   19    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
279.71 ms | 1010 KiB | 14 Q