3v4l.org

run code in 300+ PHP versions simultaneously
<?php $show_data = []; function checkVal($val, &$show_data){ return empty(show_data[$val]) ? "" : $val; } $show_insert = array( 'title' => checkVal('title'), 'thetvdb_id' => checkVal('tvdbid') ); var_dump($show_insert);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nt2SQ
function name:  (null)
number of ops:  14
compiled vars:  !0 = $show_data, !1 = $show_insert
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'checkval'
          2        SEND_VAL                                                 'title'
          3        DO_FCALL                                      0  $3      
          4        INIT_ARRAY                                       ~4      $3, 'title'
   11     5        INIT_FCALL                                               'checkval'
          6        SEND_VAL                                                 'tvdbid'
          7        DO_FCALL                                      0  $5      
          8        ADD_ARRAY_ELEMENT                                ~4      $5, 'thetvdb_id'
    9     9        ASSIGN                                                   !1, ~4
   14    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function checkval:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nt2SQ
function name:  checkVal
number of ops:  10
compiled vars:  !0 = $val, !1 = $show_data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        FETCH_CONSTANT                                   ~2      'show_data'
          3        ISSET_ISEMPTY_DIM_OBJ                         1          ~2, !0
          4      > JMPZ                                                     ~3, ->7
          5    >   QM_ASSIGN                                        ~4      ''
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~4      !0
          8    > > RETURN                                                   ~4
    7     9*     > RETURN                                                   null

End of function checkval

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.63 ms | 1398 KiB | 17 Q