3v4l.org

run code in 300+ PHP versions simultaneously
<?php $defaults = array_fill_keys(['first_name', 'last_name', 'years'], null); var_export($defaults); $_GET = [ 'last_name' => 'doe', 'Hackers' => 'can be naughty', 'years' => 5 ]; var_export($_GET); $screened = array_intersect_key($_GET, $defaults); var_export($screened); $replaced = array_replace($defaults, $screened); var_export($replaced);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sr3Ho
function name:  (null)
number of ops:  32
compiled vars:  !0 = $defaults, !1 = $screened, !2 = $replaced
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_fill_keys'
          1        SEND_VAL                                                 <array>
          2        SEND_VAL                                                 null
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    4     5        INIT_FCALL                                               'var_export'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
    6     8        FETCH_W                      global              $6      '_GET'
          9        ASSIGN                                                   $6, <array>
   11    10        INIT_FCALL                                               'var_export'
         11        FETCH_R                      global              ~8      '_GET'
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                                 
   13    14        INIT_FCALL                                               'array_intersect_key'
         15        FETCH_R                      global              ~10     '_GET'
         16        SEND_VAL                                                 ~10
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $11     
         19        ASSIGN                                                   !1, $11
   14    20        INIT_FCALL                                               'var_export'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
   16    23        INIT_FCALL                                               'array_replace'
         24        SEND_VAR                                                 !0
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                         $14     
         27        ASSIGN                                                   !2, $14
   17    28        INIT_FCALL                                               'var_export'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.23 ms | 1411 KiB | 22 Q