3v4l.org

run code in 300+ PHP versions simultaneously
<?php $copy = $columns = [ // in groups of 8 for simpler counting/reading 'naam', 'geslacht', 'fokrichting', 'kleur', 'kleur_uk', 'geb_dat2', 'fokker', 'fok_plaats', 'prijs', 'film_url', 'volgnr', 'jaar', 'extra', 'extra_uk', 'topstar', 'horsetelex_pedigree_id', 'sb_m_horsetelex_pedigree_id', 'kwpn_pedigree_id', 'sb_v', 'sb_vv', 'sb_vvv', 'sb_m', 'sb_vm', 'sb_vvm', 'sb_mm', 'sb_vmm', 'sb_vmv', 'sb_mmm', 'sb_mv', 'sb_mvv', 'sb_mmv', 'sb_mvm', 'sb_vvvv', 'sb_mvvv', 'sb_vmvv', 'sb_mmvv', 'sb_vvmv', 'sb_mvmv', 'sb_vmmv', 'sb_mmmv', 'sb_vvvm', 'sb_mvvm', 'sb_vmvm', 'sb_mmvm', 'sb_vvmm', 'sb_mvmm', 'sb_vmmm', 'sb_mmmm' ]; $column_count = sizeof($columns); sort($copy); $_POST = array_combine($copy, range(1, $column_count)); array_splice($_POST, 0, 4); // remove the first four elements as demonstration var_export($_POST); echo "\n"; $defaults = array_fill_keys($columns, null); $POST_filtered = array_intersect_key($_POST, $defaults); var_export($POST_filtered); echo "\n"; $clean_data = array_replace($defaults, $POST_filtered); var_export($clean_data); echo "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HJTRU
function name:  (null)
number of ops:  53
compiled vars:  !0 = $copy, !1 = $columns, !2 = $column_count, !3 = $defaults, !4 = $POST_filtered, !5 = $clean_data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                           ~6      !1, <array>
          1        ASSIGN                                                   !0, ~6
   10     2        COUNT                                            ~8      !1
          3        ASSIGN                                                   !2, ~8
   11     4        INIT_FCALL                                               'sort'
          5        SEND_REF                                                 !0
          6        DO_ICALL                                                 
   12     7        INIT_FCALL                                               'array_combine'
          8        SEND_VAR                                                 !0
          9        INIT_FCALL                                               'range'
         10        SEND_VAL                                                 1
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $12     
         13        SEND_VAR                                                 $12
         14        DO_ICALL                                         $13     
         15        FETCH_W                      global              $11     '_POST'
         16        ASSIGN                                                   $11, $13
   13    17        INIT_FCALL                                               'array_splice'
         18        FETCH_W                      global              $15     '_POST'
         19        SEND_REF                                                 $15
         20        SEND_VAL                                                 0
         21        SEND_VAL                                                 4
         22        DO_ICALL                                                 
   14    23        INIT_FCALL                                               'var_export'
         24        FETCH_R                      global              ~17     '_POST'
         25        SEND_VAL                                                 ~17
         26        DO_ICALL                                                 
   15    27        ECHO                                                     '%0A'
   16    28        INIT_FCALL                                               'array_fill_keys'
         29        SEND_VAR                                                 !1
         30        SEND_VAL                                                 null
         31        DO_ICALL                                         $19     
         32        ASSIGN                                                   !3, $19
   17    33        INIT_FCALL                                               'array_intersect_key'
         34        FETCH_R                      global              ~21     '_POST'
         35        SEND_VAL                                                 ~21
         36        SEND_VAR                                                 !3
         37        DO_ICALL                                         $22     
         38        ASSIGN                                                   !4, $22
   18    39        INIT_FCALL                                               'var_export'
         40        SEND_VAR                                                 !4
         41        DO_ICALL                                                 
   19    42        ECHO                                                     '%0A'
   20    43        INIT_FCALL                                               'array_replace'
         44        SEND_VAR                                                 !3
         45        SEND_VAR                                                 !4
         46        DO_ICALL                                         $25     
         47        ASSIGN                                                   !5, $25
   21    48        INIT_FCALL                                               'var_export'
         49        SEND_VAR                                                 !5
         50        DO_ICALL                                                 
   22    51        ECHO                                                     '%0A'
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.34 ms | 1400 KiB | 29 Q