3v4l.org

run code in 300+ PHP versions simultaneously
<?php function processLanguages($current, $languages) { return array_values([$current => $languages[$current]] + $languages); } $allLanguages = [ 'en' => ['locale' => 'en_US', 'code' => 'en', 'displayName' => 'English'], 'sv' => ['locale' => 'sv_SE', 'code' => 'sv', 'displayName' => 'Swedish'], 'de' => ['locale' => 'de_DE', 'code' => 'de', 'displayName' => 'German'] ]; var_dump(processLanguages('sv', $allLanguages));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qhf35
function name:  (null)
number of ops:  9
compiled vars:  !0 = $allLanguages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'processlanguages'
          3        SEND_VAL                                                 'sv'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function processlanguages:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qhf35
function name:  processLanguages
number of ops:  10
compiled vars:  !0 = $current, !1 = $languages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'array_values'
          3        FETCH_DIM_R                                      ~2      !1, !0
          4        INIT_ARRAY                                       ~3      ~2, !0
          5        ADD                                              ~4      ~3, !1
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
          8      > RETURN                                                   $5
    5     9*     > RETURN                                                   null

End of function processlanguages

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.89 ms | 1397 KiB | 18 Q