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] = $values[$languageKey] ?? $filesContent[$fileName][$languageKey][$key] ?? ''; } 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/F9v5O
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     !1, !6
          9        COALESCE                                         ~16     ~15
   18    10        FETCH_DIM_IS                                     ~17     !2, !3
         11        FETCH_DIM_IS                                     ~18     ~17, !6
         12        FETCH_DIM_IS                                     ~19     ~18, !4
         13        COALESCE                                         ~20     ~19
   19    14        QM_ASSIGN                                        ~20     ''
         15        QM_ASSIGN                                        ~16     ~20
   16    16        ASSIGN_DIM                                               !5, !6
   19    17        OP_DATA                                                  ~16
   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:
164.59 ms | 1395 KiB | 15 Q