3v4l.org

run code in 500+ PHP versions simultaneously
<?php function to_ascii_seven_segment( ... $numbers) { return implode("\n",array_map(fn($n)=>implode("\n",array_map(fn($r)=>join('',array_map(fn($d)=>substr( " _ _ _ _ _ _ _ _ ". " | | | _| _| |_| |_ |_ | |_| |_| ". " |_| | |_ _| | _| |_| | |_| _| " ,$r*44+4*(array_search($d,str_split(" 0123456789"))),4),str_split($n))),range(0,3))), $numbers)); } echo to_ascii_seven_segment( '1337', '7083170', '5318008', '53177187714' );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PQSYB
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                                   'to_ascii_seven_segment'
          1        SEND_VAL                                                     '1337'
          2        SEND_VAL                                                     '7083170'
          3        SEND_VAL                                                     '5318008'
          4        SEND_VAL                                                     '53177187714'
          5        DO_FCALL                                          0  $0      
          6        ECHO                                                         $0
          7      > RETURN                                                       1

Function to_ascii_seven_segment:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PQSYB
function name:  to_ascii_seven_segment
number of ops:  11
compiled vars:  !0 = $numbers, !1 = $r, !2 = $d
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV_VARIADIC                                        !0      
    4     1        INIT_FCALL                                                   'array_map'
          2        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
          3        BIND_LEXICAL                                                 ~3, !1
          4        BIND_LEXICAL                                                 ~3, !2
    8     5        SEND_VAL                                                     ~3
          6        SEND_VAR                                                     !0
    4     7        DO_ICALL                                             $4      
          8        FRAMELESS_ICALL_2                implode             ~5      '%0A', $4
    8     9      > RETURN                                                       ~5
    9    10*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PQSYB
function name:  {closure:to_ascii_seven_segment():4}
number of ops:  17
compiled vars:  !0 = $n, !1 = $r, !2 = $d
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        BIND_STATIC                                                  !2
          3        INIT_FCALL                                                   'array_map'
          4        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
          5        BIND_LEXICAL                                                 ~3, !2
          6        BIND_LEXICAL                                                 ~3, !0
    8     7        SEND_VAL                                                     ~3
          8        INIT_FCALL                                                   'range'
          9        SEND_VAL                                                     0
         10        SEND_VAL                                                     3
         11        DO_ICALL                                             $4      
         12        SEND_VAR                                                     $4
    4    13        DO_ICALL                                             $5      
         14        FRAMELESS_ICALL_2                implode             ~6      '%0A', $5
    8    15      > RETURN                                                       ~6
         16*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PQSYB
function name:  {closure:{closure:to_ascii_seven_segment():4}:4}
number of ops:  18
compiled vars:  !0 = $r, !1 = $d, !2 = $n
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        BIND_STATIC                                                  !2
          3        INIT_FCALL                                                   'join'
          4        SEND_VAL                                                     ''
          5        INIT_FCALL                                                   'array_map'
          6        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
          7        BIND_LEXICAL                                                 ~3, !0
    8     8        SEND_VAL                                                     ~3
          9        INIT_FCALL                                                   'str_split'
         10        SEND_VAR                                                     !2
         11        DO_ICALL                                             $4      
         12        SEND_VAR                                                     $4
    4    13        DO_ICALL                                             $5      
    8    14        SEND_VAR                                                     $5
    4    15        DO_ICALL                                             $6      
    8    16      > RETURN                                                       $6
         17*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PQSYB
function name:  {closure:{closure:{closure:to_ascii_seven_segment():4}:4}:4}
number of ops:  16
compiled vars:  !0 = $d, !1 = $r
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
    8     2        MUL                                                  ~2      !1, 44
          3        INIT_FCALL                                                   'array_search'
          4        SEND_VAR                                                     !0
          5        INIT_FCALL                                                   'str_split'
          6        SEND_VAL                                                     '+0123456789'
          7        DO_ICALL                                             $3      
          8        SEND_VAR                                                     $3
          9        DO_ICALL                                             $4      
         10        MUL                                                  ~5      $4, 4
         11        ADD                                                  ~6      ~2, ~5
    4    12        FRAMELESS_ICALL_3                substr              ~7      '+++++_+++++++_+++_+++++++_+++_+++_+++_+++_++++++%7C+%7C+++%7C++_%7C++_%7C+%7C_%7C+%7C_++%7C_++++%7C+%7C_%7C+%7C_%7C+++++%7C_%7C+++%7C+%7C_+++_%7C+++%7C++_%7C+%7C_%7C+++%7C+%7C_%7C++_%7C+', ~6
    8    13        OP_DATA                                                      4
         14      > RETURN                                                       ~7
         15*     > RETURN                                                       null

End of Dynamic Function 0

End of Dynamic Function 0

End of Dynamic Function 0

End of function to_ascii_seven_segment

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.93 ms | 2226 KiB | 19 Q