3v4l.org

run code in 500+ PHP versions simultaneously
<?php $params = [ 'locale' => 'en_US', 'sig' => '123456789', 'bah' => 'beh', 'foo' => 'barPA', ]; $payloadParams = [ 'foo' => 'barPL', 'locale' => 'de_CH', 'config' => ['bar1' => 'foo1', 'bar2' => 'foo2'] ]; //Reset $params to avoid inhection of unwanted values via parameters, only allow locale and sig $params = array_merge($payloadParams, array_filter(['locale'=>($params['locale'] ?? null), 'sig'=>($params['sig'] ?? null)])); print_r($params);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oqDc7
function name:  (null)
number of ops:  22
compiled vars:  !0 = $params, !1 = $payloadParams
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        ASSIGN                                                       !1, <array>
   17     2        INIT_FCALL                                                   'array_merge'
          3        SEND_VAR                                                     !1
          4        INIT_FCALL                                                   'array_filter'
          5        FETCH_DIM_IS                                         ~4      !0, 'locale'
          6        COALESCE                                             ~5      ~4
          7        QM_ASSIGN                                            ~5      null
          8        INIT_ARRAY                                           ~6      ~5, 'locale'
          9        FETCH_DIM_IS                                         ~7      !0, 'sig'
         10        COALESCE                                             ~8      ~7
         11        QM_ASSIGN                                            ~8      null
         12        ADD_ARRAY_ELEMENT                                    ~6      ~8, 'sig'
         13        SEND_VAL                                                     ~6
         14        DO_ICALL                                             $9      
         15        SEND_VAR                                                     $9
         16        DO_ICALL                                             $10     
         17        ASSIGN                                                       !0, $10
   19    18        INIT_FCALL                                                   'print_r'
         19        SEND_VAR                                                     !0
         20        DO_ICALL                                                     
         21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.49 ms | 1322 KiB | 16 Q