3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*The task is to print out numbers 1 through 100 but for multiples of 3 print out “Fizz” instead of the number and for multiples of 5 print “Buzz” instead. If the number happens to be divisble by both 3 and 5 print out “FizzBuzz” instead of the number.*/ for ($i = 1; $i <= 100; $i++) { $Fizz = ($i % 3 === 0); $Buzz = ($i % 5 === 0); $FizzBuzz = ($Fizz === true && $Buzz === true); foreach (array_splice(get_defined_vars(), 0, 2) as $key => $var) { echo ($var === true) ? $key : $i; } echo $var, PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 2
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 30
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 30
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 2
Branch analysis from position: 36
Branch analysis from position: 2
Branch analysis from position: 30
Branch analysis from position: 12
filename:       /in/fRq1n
function name:  (null)
number of ops:  37
compiled vars:  !0 = $i, !1 = $Fizz, !2 = $Buzz, !3 = $FizzBuzz, !4 = $var, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 1
          1      > JMP                                                      ->34
    7     2    >   MOD                                              ~7      !0, 3
          3        IS_IDENTICAL                                     ~8      ~7, 0
          4        ASSIGN                                                   !1, ~8
    8     5        MOD                                              ~10     !0, 5
          6        IS_IDENTICAL                                     ~11     ~10, 0
          7        ASSIGN                                                   !2, ~11
    9     8        TYPE_CHECK                                    8  ~13     !1
          9      > JMPZ_EX                                          ~13     ~13, ->12
         10    >   TYPE_CHECK                                    8  ~14     !2
         11        BOOL                                             ~13     ~14
         12    >   ASSIGN                                                   !3, ~13
   11    13        INIT_FCALL                                               'array_splice'
         14        INIT_FCALL                                               'get_defined_vars'
         15        DO_ICALL                                         $16     
         16        SEND_VAR_NO_REF                               0          $16
         17        SEND_VAL                                                 0
         18        SEND_VAL                                                 2
         19        DO_ICALL                                         $17     
         20      > FE_RESET_R                                       $18     $17, ->30
         21    > > FE_FETCH_R                                       ~19     $18, !4, ->30
         22    >   ASSIGN                                                   !5, ~19
   13    23        TYPE_CHECK                                    8          !4
         24      > JMPZ                                                     ~21, ->27
         25    >   QM_ASSIGN                                        ~22     !5
         26      > JMP                                                      ->28
         27    >   QM_ASSIGN                                        ~22     !0
         28    >   ECHO                                                     ~22
   11    29      > JMP                                                      ->21
         30    >   FE_FREE                                                  $18
   16    31        ECHO                                                     !4
         32        ECHO                                                     '%0A'
    5    33        PRE_INC                                                  !0
         34    >   IS_SMALLER_OR_EQUAL                                      !0, 100
         35      > JMPNZ                                                    ~24, ->2
   17    36    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.63 ms | 1400 KiB | 17 Q