3v4l.org

run code in 300+ PHP versions simultaneously
<?php $low=0; $high=100; $args=getopt( "l:h:"); foreach($args as $k=>$v) { switch($k) { case 'h': $high=intval($v); break; case 'l': $low=intval($v); break; default: echo(" Unknown value $k=>$v"); } } var_dump(calculate($low, $high)); function calculate($low, $high) { $out=array(); for($i=$low; $i<=$high; $i++) { switch($i) { case ($i % 3 ==0) && ($i % 5==0) : $out[$i]="Fizzbuzz"; break; case ($i % 3==0) : $out[$i]="Fizz"; break; case ($i % 5==0) : $out[$i]="Buzz"; break; default: $out[$i]="".$i; } } return $out; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 27
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 27
Branch analysis from position: 8
4 jumps found. (Code = 188) Position 1 = 15, Position 2 = 18, Position 3 = 21, Position 4 = 10
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 18
Branch analysis from position: 15
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/qgZ0a
function name:  (null)
number of ops:  36
compiled vars:  !0 = $low, !1 = $high, !2 = $args, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
          1        ASSIGN                                                   !1, 100
    4     2        INIT_FCALL                                               'getopt'
          3        SEND_VAL                                                 'l%3Ah%3A'
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !2, $7
    5     6      > FE_RESET_R                                       $9      !2, ->27
          7    > > FE_FETCH_R                                       ~10     $9, !3, ->27
          8    >   ASSIGN                                                   !4, ~10
    6     9      > SWITCH_STRING                                            !4, [ 'h':->15, 'l':->18, ], ->21
    7    10    >   IS_EQUAL                                                 !4, 'h'
         11      > JMPNZ                                                    ~12, ->15
    8    12    >   IS_EQUAL                                                 !4, 'l'
         13      > JMPNZ                                                    ~12, ->18
         14    > > JMP                                                      ->21
    7    15    >   CAST                                          4  ~13     !3
         16        ASSIGN                                                   !1, ~13
         17      > JMP                                                      ->26
    8    18    >   CAST                                          4  ~15     !3
         19        ASSIGN                                                   !0, ~15
         20      > JMP                                                      ->26
    9    21    >   ROPE_INIT                                     4  ~18     '+Unknown+value+'
         22        ROPE_ADD                                      1  ~18     ~18, !4
         23        ROPE_ADD                                      2  ~18     ~18, '%3D%3E'
         24        ROPE_END                                      3  ~17     ~18, !3
         25        ECHO                                                     ~17
    5    26    > > JMP                                                      ->7
         27    >   FE_FREE                                                  $9
   12    28        INIT_FCALL                                               'var_dump'
         29        INIT_FCALL_BY_NAME                                       'calculate'
         30        SEND_VAR_EX                                              !0
         31        SEND_VAR_EX                                              !1
         32        DO_FCALL                                      0  $20     
         33        SEND_VAR                                                 $20
         34        DO_ICALL                                                 
   34    35      > RETURN                                                   1

Function calculate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 5
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 5
Branch analysis from position: 37
Branch analysis from position: 5
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 11
filename:       /in/qgZ0a
function name:  calculate
number of ops:  39
compiled vars:  !0 = $low, !1 = $high, !2 = $out, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        ASSIGN                                                   !2, <array>
   18     3        ASSIGN                                                   !3, !0
          4      > JMP                                                      ->35
   20     5    >   MOD                                              ~7      !3, 3
          6        IS_EQUAL                                         ~8      ~7, 0
          7      > JMPZ_EX                                          ~8      ~8, ->11
          8    >   MOD                                              ~9      !3, 5
          9        IS_EQUAL                                         ~10     ~9, 0
         10        BOOL                                             ~8      ~10
         11    >   IS_EQUAL                                                 !3, ~8
         12      > JMPNZ                                                    ~6, ->22
   23    13    >   MOD                                              ~11     !3, 3
         14        IS_EQUAL                                         ~12     ~11, 0
         15        IS_EQUAL                                                 !3, ~12
         16      > JMPNZ                                                    ~6, ->25
   26    17    >   MOD                                              ~13     !3, 5
         18        IS_EQUAL                                         ~14     ~13, 0
         19        IS_EQUAL                                                 !3, ~14
         20      > JMPNZ                                                    ~6, ->28
         21    > > JMP                                                      ->31
   21    22    >   ASSIGN_DIM                                               !2, !3
         23        OP_DATA                                                  'Fizzbuzz'
   22    24      > JMP                                                      ->34
   24    25    >   ASSIGN_DIM                                               !2, !3
         26        OP_DATA                                                  'Fizz'
   25    27      > JMP                                                      ->34
   27    28    >   ASSIGN_DIM                                               !2, !3
         29        OP_DATA                                                  'Buzz'
   28    30      > JMP                                                      ->34
   30    31    >   CONCAT                                           ~19     '', !3
         32        ASSIGN_DIM                                               !2, !3
         33        OP_DATA                                                  ~19
   18    34    >   PRE_INC                                                  !3
         35    >   IS_SMALLER_OR_EQUAL                                      !3, !1
         36      > JMPNZ                                                    ~21, ->5
   33    37    > > RETURN                                                   !2
   34    38*     > RETURN                                                   null

End of function calculate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.23 ms | 1404 KiB | 17 Q