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',$show_data), 'thetvdb_id' => checkVal('tvdbid',$show_data) ); var_dump($show_insert);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j3Ter
function name:  (null)
number of ops:  16
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        SEND_REF                                                 !0
          4        DO_FCALL                                      0  $3      
          5        INIT_ARRAY                                       ~4      $3, 'title'
   11     6        INIT_FCALL                                               'checkval'
          7        SEND_VAL                                                 'tvdbid'
          8        SEND_REF                                                 !0
          9        DO_FCALL                                      0  $5      
         10        ADD_ARRAY_ELEMENT                                ~4      $5, 'thetvdb_id'
    9    11        ASSIGN                                                   !1, ~4
   14    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > 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/j3Ter
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:
164.84 ms | 1399 KiB | 17 Q