3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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'] ]; $currentLanguage = 'sv'; $allLanguages = array_values([$currentLanguage => $allLanguages[$currentLanguage]] + $allLanguages); var_dump($allLanguages);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PpsGT
function name:  (null)
number of ops:  13
compiled vars:  !0 = $allLanguages, !1 = $currentLanguage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, 'sv'
   11     2        INIT_FCALL                                               'array_values'
          3        FETCH_DIM_R                                      ~4      !0, !1
          4        INIT_ARRAY                                       ~5      ~4, !1
          5        ADD                                              ~6      ~5, !0
          6        SEND_VAL                                                 ~6
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !0, $7
   13     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.54 ms | 1394 KiB | 17 Q