3v4l.org

run code in 500+ PHP versions simultaneously
<?php $keys = [ 'staff_first_name' => null, 'staff_last_name' => null, 'staff_years' => null ]; $submitted_values = [ 'first_name' => 'jon', 'last_name' => 'doe', 'years' => 5 ]; foreach ($keys as $key => &$value) { $value = $submitted_values[substr($key, 6)] ?? $value; } var_export($keys);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/3dAV0
function name:  (null)
number of ops:  16
compiled vars:  !0 = $keys, !1 = $submitted_values, !2 = $value, !3 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        ASSIGN                                                       !1, <array>
   15     2      > FE_RESET_RW                                          $6      !0, ->11
          3    > > FE_FETCH_RW                                          ~7      $6, !2, ->11
          4    >   ASSIGN                                                       !3, ~7
   16     5        FRAMELESS_ICALL_2                substr              ~9      !3, 6
          6        FETCH_DIM_IS                                         ~10     !1, ~9
          7        COALESCE                                             ~11     ~10
          8        QM_ASSIGN                                            ~11     !2
          9        ASSIGN                                                       !2, ~11
   15    10      > JMP                                                          ->3
         11    >   FE_FREE                                                      $6
   18    12        INIT_FCALL                                                   'var_export'
         13        SEND_VAR                                                     !0
         14        DO_ICALL                                                     
         15      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
202.4 ms | 1773 KiB | 14 Q