3v4l.org

run code in 300+ PHP versions simultaneously
<?php $defaults = [ 'it' => 'it-IT', 'en' => 'en-US', 'es' => 'es-ES', // ... ]; $requests = [ 'it', 'it-IT', 'en-GB', 'en', 'es-AR', 'es-MX', 'es', ]; foreach ($requests as $input) { $output = $defaults[$input] ?? $input; echo "$input -> $output\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/pJHWA
function name:  (null)
number of ops:  16
compiled vars:  !0 = $defaults, !1 = $requests, !2 = $input, !3 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   18     2      > FE_RESET_R                                       $6      !1, ->14
          3    > > FE_FETCH_R                                               $6, !2, ->14
   19     4    >   FETCH_DIM_IS                                     ~7      !0, !2
          5        COALESCE                                         ~8      ~7
          6        QM_ASSIGN                                        ~8      !2
          7        ASSIGN                                                   !3, ~8
   20     8        ROPE_INIT                                     4  ~11     !2
          9        ROPE_ADD                                      1  ~11     ~11, '+-%3E+'
         10        ROPE_ADD                                      2  ~11     ~11, !3
         11        ROPE_END                                      3  ~10     ~11, '%0A'
         12        ECHO                                                     ~10
   18    13      > JMP                                                      ->3
         14    >   FE_FREE                                                  $6
   21    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.37 ms | 1001 KiB | 13 Q