3v4l.org

run code in 500+ PHP versions simultaneously
<?php $days = [ 1 => 'Sunday', 2 => 'Monday', 3 => 'Tuesday', 4 => 'Wednesday', 5 => 'Thursday', 6 => 'Friday', 7 => 'Saturday' ]; $array = [7,3,4]; $result = array_map(function ($a) use($days) { return $days[$a]; }, $array); echo "Day in name= ".implode(',', $result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Zb5M
function name:  (null)
number of ops:  13
compiled vars:  !0 = $days, !1 = $array, !2 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   11     1        ASSIGN                                                       !1, <array>
   12     2        INIT_FCALL                                                   'array_map'
          3        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          4        BIND_LEXICAL                                                 ~5, !0
          5        SEND_VAL                                                     ~5
          6        SEND_VAR                                                     !1
          7        DO_ICALL                                             $6      
          8        ASSIGN                                                       !2, $6
   13     9        FRAMELESS_ICALL_2                implode             ~8      '%2C', !2
         10        CONCAT                                               ~9      'Day+in+name%3D+', ~8
         11        ECHO                                                         ~9
         12      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Zb5M
function name:  {closure:/in/9Zb5M:12}
number of ops:  5
compiled vars:  !0 = $a, !1 = $days
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        FETCH_DIM_R                                          ~2      !1, !0
          3      > RETURN                                                       ~2
          4*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.99 ms | 2101 KiB | 14 Q