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/etRJH
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 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/etRJH
function name:  checkVal
number of ops:  9
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        ISSET_ISEMPTY_DIM_OBJ                         1          !1, !0
          3      > JMPZ                                                     ~2, ->6
          4    >   QM_ASSIGN                                        ~3      ''
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~3      !0
          7    > > RETURN                                                   ~3
    7     8*     > RETURN                                                   null

End of function checkval

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.71 ms | 1389 KiB | 17 Q