3v4l.org

run code in 300+ PHP versions simultaneously
<?php function flavor ($type = null) { switch($type): default: $type = null; case $array[] = "Coklat": if ($type != null){ $array = array($type); break; } case $array[] = "Stroberi"; if ($type != null) { $array = array($type); break; } case $array[] = "Vanila"; if ($type != null) { $array = array($type); break; } endswitch; if ( (count($array) != 1)) { return "Rasa tersedia: " .implode (", ", $array); } else{ return "Rasa yang terpilih: " .implode (", ", $array); } } echo flavor() . "<br>"; /* Flavors available: chocolate, strawberry, vanilla */ echo flavor("banana") . "<br>"; /* Flavors available: chocolate, strawberry, vanilla */ echo flavor("chocolate") . "<br>"; /* Flavor selected: chocolate */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DN75Y
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'flavor'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      $0, '%3Cbr%3E'
          3        ECHO                                                     ~1
   26     4        INIT_FCALL                                               'flavor'
          5        SEND_VAL                                                 'banana'
          6        DO_FCALL                                      0  $2      
          7        CONCAT                                           ~3      $2, '%3Cbr%3E'
          8        ECHO                                                     ~3
   29     9        INIT_FCALL                                               'flavor'
         10        SEND_VAL                                                 'chocolate'
         11        DO_FCALL                                      0  $4      
         12        CONCAT                                           ~5      $4, '%3Cbr%3E'
         13        ECHO                                                     ~5
   30    14      > RETURN                                                   1

Function flavor:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 40
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 30
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 30
Branch analysis from position: 25
Branch analysis from position: 20
Branch analysis from position: 15
filename:       /in/DN75Y
function name:  flavor
number of ops:  47
compiled vars:  !0 = $type, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      null
    7     1        ASSIGN_DIM                                       ~3      !1
          2        OP_DATA                                                  'Coklat'
          3        IS_EQUAL                                                 !0, ~3
          4      > JMPNZ                                                    ~2, ->15
    9     5    >   ASSIGN_DIM                                       ~4      !1
          6        OP_DATA                                                  'Stroberi'
          7        IS_EQUAL                                                 !0, ~4
          8      > JMPNZ                                                    ~2, ->20
   11     9    >   ASSIGN_DIM                                       ~5      !1
         10        OP_DATA                                                  'Vanila'
         11        IS_EQUAL                                                 !0, ~5
         12      > JMPNZ                                                    ~2, ->25
         13    > > JMP                                                      ->14
    6    14    >   ASSIGN                                                   !0, null
    8    15    >   IS_NOT_EQUAL                                             !0, null
         16      > JMPZ                                                     ~7, ->20
         17    >   INIT_ARRAY                                       ~8      !0
         18        ASSIGN                                                   !1, ~8
         19      > JMP                                                      ->30
   10    20    >   IS_NOT_EQUAL                                             !0, null
         21      > JMPZ                                                     ~10, ->25
         22    >   INIT_ARRAY                                       ~11     !0
         23        ASSIGN                                                   !1, ~11
         24      > JMP                                                      ->30
   12    25    >   IS_NOT_EQUAL                                             !0, null
         26      > JMPZ                                                     ~13, ->30
         27    >   INIT_ARRAY                                       ~14     !0
         28        ASSIGN                                                   !1, ~14
         29      > JMP                                                      ->30
   15    30    >   COUNT                                            ~16     !1
         31        IS_NOT_EQUAL                                             ~16, 1
         32      > JMPZ                                                     ~17, ->40
   16    33    >   INIT_FCALL                                               'implode'
         34        SEND_VAL                                                 '%2C+'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                         $18     
         37        CONCAT                                           ~19     'Rasa+tersedia%3A+', $18
         38      > RETURN                                                   ~19
         39*       JMP                                                      ->46
   19    40    >   INIT_FCALL                                               'implode'
         41        SEND_VAL                                                 '%2C+'
         42        SEND_VAR                                                 !1
         43        DO_ICALL                                         $20     
         44        CONCAT                                           ~21     'Rasa+yang+terpilih%3A+', $20
         45      > RETURN                                                   ~21
   21    46*     > RETURN                                                   null

End of function flavor

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.62 ms | 1394 KiB | 18 Q