3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allLanguages = ['en', 'es', 'fr']; $values = ['es' => 'Spanish1']; $filesContent = [ 'foo' => [ 'es' => ['bar' => 'Spanish2'], 'fr' => ['bar' => 'French'] ] ]; $fileName = 'foo'; $key = 'bar'; $original = []; foreach ($allLanguages as $languageKey) { $original[$languageKey] = $filesContent[$fileName][$languageKey][$key] ?? $values[$languageKey] ?? ''; } var_export($original);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/pQ08m
function name:  (null)
number of ops:  24
compiled vars:  !0 = $allLanguages, !1 = $values, !2 = $filesContent, !3 = $fileName, !4 = $key, !5 = $original, !6 = $languageKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
   11     3        ASSIGN                                                   !3, 'foo'
   12     4        ASSIGN                                                   !4, 'bar'
   14     5        ASSIGN                                                   !5, <array>
   15     6      > FE_RESET_R                                       $13     !0, ->19
          7    > > FE_FETCH_R                                               $13, !6, ->19
   17     8    >   FETCH_DIM_IS                                     ~15     !2, !3
          9        FETCH_DIM_IS                                     ~16     ~15, !6
         10        FETCH_DIM_IS                                     ~17     ~16, !4
         11        COALESCE                                         ~18     ~17
   18    12        FETCH_DIM_IS                                     ~19     !1, !6
         13        COALESCE                                         ~20     ~19
   19    14        QM_ASSIGN                                        ~20     ''
         15        QM_ASSIGN                                        ~18     ~20
   16    16        ASSIGN_DIM                                               !5, !6
   19    17        OP_DATA                                                  ~18
   15    18      > JMP                                                      ->7
         19    >   FE_FREE                                                  $13
   21    20        INIT_FCALL                                               'var_export'
         21        SEND_VAR                                                 !5
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
196.97 ms | 1451 KiB | 14 Q