3v4l.org

run code in 500+ PHP versions simultaneously
<?php function to_ascii_seven_segment( ... $numbers) { $g=fn($d)=>is_numeric($d)?hexdec(substr('00f59079d99ccded91fddd',$d+1<<1,2))<<1:0;$q=' |_'; $j=fn($c,$v,$s="\n")=>join($s,array_map($c,$v)); return @$j(fn($n)=>$j(fn($r)=>$j(fn($d)=> $q[0<($g($d)&1<<$r++)].$q[(0<($g($d)&1<<$r++))<<1].$q[0<($g($d)&1<<$r++)], str_split($n),''),range(0,9,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/899oJ
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     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/899oJ
function name:  to_ascii_seven_segment
number of ops:  20
compiled vars:  !0 = $numbers, !1 = $g, !2 = $q, !3 = $j, !4 = $d, !5 = $r
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV_VARIADIC                                        !0      
    4     1        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          2        ASSIGN                                                       !1, ~6
          3        ASSIGN                                                       !2, '+%7C_'
    5     4        DECLARE_LAMBDA_FUNCTION                              ~9      [1]
          5        ASSIGN                                                       !3, ~9
    6     6        BEGIN_SILENCE                                        ~11     
          7        INIT_DYNAMIC_CALL                                            !3
          8        DECLARE_LAMBDA_FUNCTION                              ~12     [2]
          9        BIND_LEXICAL                                                 ~12, !3
         10        BIND_LEXICAL                                                 ~12, !2
         11        BIND_LEXICAL                                                 ~12, !1
         12        BIND_LEXICAL                                                 ~12, !4
         13        BIND_LEXICAL                                                 ~12, !5
    8    14        SEND_VAL_EX                                                  ~12
    6    15        SEND_VAR_EX                                                  !0
         16        DO_FCALL                                          0  $13     
         17        END_SILENCE                                                  ~11
         18      > RETURN                                                       $13
    9    19*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/899oJ
function name:  {closure:to_ascii_seven_segment():4}
number of ops:  16
compiled vars:  !0 = $d
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        FRAMELESS_ICALL_1                is_numeric          ~1      !0
          2      > JMPZ                                                         ~1, ->13
          3    >   INIT_FCALL                                                   'hexdec'
          4        ADD                                                  ~2      !0, 1
          5        SL                                                   ~3      ~2, 1
          6        FRAMELESS_ICALL_3                substr              ~4      '00f59079d99ccded91fddd', ~3
          7        OP_DATA                                                      2
          8        SEND_VAL                                                     ~4
          9        DO_ICALL                                             $5      
         10        SL                                                   ~6      $5, 1
         11        QM_ASSIGN                                            ~7      ~6
         12      > JMP                                                          ->14
         13    >   QM_ASSIGN                                            ~7      0
         14    > > RETURN                                                       ~7
         15*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/899oJ
function name:  {closure:to_ascii_seven_segment():5}
number of ops:  13
compiled vars:  !0 = $c, !1 = $v, !2 = $s
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV_INIT                                            !2      '%0A'
          3        INIT_FCALL                                                   'join'
          4        SEND_VAR                                                     !2
          5        INIT_FCALL                                                   'array_map'
          6        SEND_VAR                                                     !0
          7        SEND_VAR                                                     !1
          8        DO_ICALL                                             $3      
          9        SEND_VAR                                                     $3
         10        DO_ICALL                                             $4      
         11      > RETURN                                                       $4
         12*     > RETURN                                                       null

End of Dynamic Function 1

Dynamic Function 2
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/899oJ
function name:  {closure:to_ascii_seven_segment():6}
number of ops:  23
compiled vars:  !0 = $n, !1 = $j, !2 = $q, !3 = $g, !4 = $d, !5 = $r
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        BIND_STATIC                                                  !2
          3        BIND_STATIC                                                  !3
          4        BIND_STATIC                                                  !4
          5        BIND_STATIC                                                  !5
          6        INIT_DYNAMIC_CALL                                            !1
          7        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          8        BIND_LEXICAL                                                 ~6, !1
          9        BIND_LEXICAL                                                 ~6, !2
         10        BIND_LEXICAL                                                 ~6, !3
         11        BIND_LEXICAL                                                 ~6, !4
         12        BIND_LEXICAL                                                 ~6, !0
    8    13        SEND_VAL_EX                                                  ~6
         14        INIT_FCALL                                                   'range'
         15        SEND_VAL                                                     0
         16        SEND_VAL                                                     9
         17        SEND_VAL                                                     3
         18        DO_ICALL                                             $7      
         19        SEND_VAR_NO_REF_EX                                           $7
    6    20        DO_FCALL                                          0  $8      
    8    21      > RETURN                                                       $8
         22*     > 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/899oJ
function name:  {closure:{closure:to_ascii_seven_segment():6}:6}
number of ops:  20
compiled vars:  !0 = $r, !1 = $j, !2 = $q, !3 = $g, !4 = $d, !5 = $n
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        BIND_STATIC                                                  !2
          3        BIND_STATIC                                                  !3
          4        BIND_STATIC                                                  !4
          5        BIND_STATIC                                                  !5
          6        INIT_DYNAMIC_CALL                                            !1
          7        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          8        BIND_LEXICAL                                                 ~6, !2
          9        BIND_LEXICAL                                                 ~6, !3
         10        BIND_LEXICAL                                                 ~6, !0
    7    11        SEND_VAL_EX                                                  ~6
    8    12        INIT_FCALL                                                   'str_split'
         13        SEND_VAR                                                     !5
         14        DO_ICALL                                             $7      
         15        SEND_VAR_NO_REF_EX                                           $7
         16        SEND_VAL_EX                                                  ''
    6    17        DO_FCALL                                          0  $8      
    8    18      > RETURN                                                       $8
         19*     > 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/899oJ
function name:  {closure:{closure:{closure:to_ascii_seven_segment():6}:6}:6}
number of ops:  33
compiled vars:  !0 = $d, !1 = $q, !2 = $g, !3 = $r
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        BIND_STATIC                                                  !2
          3        BIND_STATIC                                                  !3
    7     4        INIT_DYNAMIC_CALL                                            !2
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0  $4      
          7        POST_INC                                             ~5      !3
          8        SL                                                   ~6      1, ~5
          9        BW_AND                                               ~7      $4, ~6
         10        IS_SMALLER                                           ~8      0, ~7
         11        FETCH_DIM_R                                          ~9      !1, ~8
         12        INIT_DYNAMIC_CALL                                            !2
         13        SEND_VAR_EX                                                  !0
         14        DO_FCALL                                          0  $10     
         15        POST_INC                                             ~11     !3
         16        SL                                                   ~12     1, ~11
         17        BW_AND                                               ~13     $10, ~12
         18        IS_SMALLER                                           ~14     0, ~13
         19        SL                                                   ~15     ~14, 1
         20        FETCH_DIM_R                                          ~16     !1, ~15
         21        CONCAT                                               ~17     ~9, ~16
         22        INIT_DYNAMIC_CALL                                            !2
         23        SEND_VAR_EX                                                  !0
         24        DO_FCALL                                          0  $18     
         25        POST_INC                                             ~19     !3
         26        SL                                                   ~20     1, ~19
         27        BW_AND                                               ~21     $18, ~20
         28        IS_SMALLER                                           ~22     0, ~21
         29        FETCH_DIM_R                                          ~23     !1, ~22
         30        CONCAT                                               ~24     ~17, ~23
         31      > RETURN                                                       ~24
         32*     > RETURN                                                       null

End of Dynamic Function 0

End of Dynamic Function 0

End of Dynamic Function 2

End of function to_ascii_seven_segment

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.19 ms | 2225 KiB | 19 Q