3v4l.org

run code in 300+ 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:  16
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        INIT_FCALL                                               'implode'
         10        SEND_VAL                                                 '%2C'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $8      
         13        CONCAT                                           ~9      'Day+in+name%3D+', $8
         14        ECHO                                                     ~9
         15      > 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}
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.0.0


preferences:
144.09 ms | 999 KiB | 15 Q