3v4l.org

run code in 300+ PHP versions simultaneously
<?php function outputOptions(array $options){ if ($options[0] == 'email') { echo "You can send the selected records to your email."; } else { echo "You can download the selected records in $options[0]"; $last = count($options) - 1; if($last == 0) echo '.'; else { for($i = 1; $i < $last; $i++) echo ", $options[$i]"; echo $options[$last] == 'email' ? ', or send them to your email.' : ", or $options[$last]."; } } echo "\n"; } outputOptions(['Word']); outputOptions(['Word', 'Excel']); outputOptions(['Word', 'PDF']); outputOptions(['Word', 'Excel', 'PDF']); outputOptions(['email']); outputOptions(['Word', 'email']); outputOptions(['Word', 'Excel', 'email']); outputOptions(['Word', 'PDF', 'email']); outputOptions(['Word', 'Excel', 'PDF', 'email']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fYcMc
function name:  (null)
number of ops:  28
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'outputoptions'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0          
   25     3        INIT_FCALL                                               'outputoptions'
          4        SEND_VAL                                                 <array>
          5        DO_FCALL                                      0          
   26     6        INIT_FCALL                                               'outputoptions'
          7        SEND_VAL                                                 <array>
          8        DO_FCALL                                      0          
   27     9        INIT_FCALL                                               'outputoptions'
         10        SEND_VAL                                                 <array>
         11        DO_FCALL                                      0          
   29    12        INIT_FCALL                                               'outputoptions'
         13        SEND_VAL                                                 <array>
         14        DO_FCALL                                      0          
   30    15        INIT_FCALL                                               'outputoptions'
         16        SEND_VAL                                                 <array>
         17        DO_FCALL                                      0          
   31    18        INIT_FCALL                                               'outputoptions'
         19        SEND_VAL                                                 <array>
         20        DO_FCALL                                      0          
   32    21        INIT_FCALL                                               'outputoptions'
         22        SEND_VAL                                                 <array>
         23        DO_FCALL                                      0          
   33    24        INIT_FCALL                                               'outputoptions'
         25        SEND_VAL                                                 <array>
         26        DO_FCALL                                      0          
         27      > RETURN                                                   1

Function outputoptions:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 19
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 19
Branch analysis from position: 26
Branch analysis from position: 19
filename:       /in/fYcMc
function name:  outputOptions
number of ops:  39
compiled vars:  !0 = $options, !1 = $last, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_DIM_R                                      ~3      !0, 0
          2        IS_EQUAL                                                 ~3, 'email'
          3      > JMPZ                                                     ~4, ->6
    5     4    >   ECHO                                                     'You+can+send+the+selected+records+to+your+email.'
    4     5      > JMP                                                      ->37
    7     6    >   NOP                                                      
          7        FETCH_DIM_R                                      ~5      !0, 0
          8        FAST_CONCAT                                      ~6      'You+can+download+the+selected+records+in+', ~5
          9        ECHO                                                     ~6
    8    10        COUNT                                            ~7      !0
         11        SUB                                              ~8      ~7, 1
         12        ASSIGN                                                   !1, ~8
   10    13        IS_EQUAL                                                 !1, 0
         14      > JMPZ                                                     ~10, ->17
   11    15    >   ECHO                                                     '.'
   10    16      > JMP                                                      ->37
   13    17    >   ASSIGN                                                   !2, 1
         18      > JMP                                                      ->24
   14    19    >   NOP                                                      
         20        FETCH_DIM_R                                      ~12     !0, !2
         21        FAST_CONCAT                                      ~13     '%2C+', ~12
         22        ECHO                                                     ~13
   13    23        PRE_INC                                                  !2
         24    >   IS_SMALLER                                               !2, !1
         25      > JMPNZ                                                    ~15, ->19
   16    26    >   FETCH_DIM_R                                      ~16     !0, !1
         27        IS_EQUAL                                                 ~16, 'email'
         28      > JMPZ                                                     ~17, ->31
   17    29    >   QM_ASSIGN                                        ~18     '%2C+or+send+them+to+your+email.'
         30      > JMP                                                      ->36
   18    31    >   ROPE_INIT                                     3  ~21     '%2C+or+'
         32        FETCH_DIM_R                                      ~19     !0, !1
         33        ROPE_ADD                                      1  ~21     ~21, ~19
         34        ROPE_END                                      2  ~20     ~21, '.'
         35        QM_ASSIGN                                        ~18     ~20
         36    >   ECHO                                                     ~18
   21    37    >   ECHO                                                     '%0A'
   22    38      > RETURN                                                   null

End of function outputoptions

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
229.9 ms | 1019 KiB | 22 Q