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, 1) as $key => $var) { echo ($var === true) ? $key : $i, PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 2
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 26
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 26
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 2
Branch analysis from position: 30
Branch analysis from position: 2
Branch analysis from position: 26
filename:       /in/9XBOg
function name:  (null)
number of ops:  31
compiled vars:  !0 = $i, !1 = $Fizz, !2 = $Buzz, !3 = $var, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 1
          1      > JMP                                                      ->28
    7     2    >   MOD                                              ~6      !0, 3
          3        IS_IDENTICAL                                     ~7      ~6, 0
          4        ASSIGN                                                   !1, ~7
    8     5        MOD                                              ~9      !0, 5
          6        IS_IDENTICAL                                     ~10     ~9, 0
          7        ASSIGN                                                   !2, ~10
   11     8        INIT_FCALL                                               'array_splice'
          9        INIT_FCALL                                               'get_defined_vars'
         10        DO_ICALL                                         $12     
         11        SEND_VAR_NO_REF                               0          $12
         12        SEND_VAL                                                 0
         13        SEND_VAL                                                 1
         14        DO_ICALL                                         $13     
         15      > FE_RESET_R                                       $14     $13, ->26
         16    > > FE_FETCH_R                                       ~15     $14, !3, ->26
         17    >   ASSIGN                                                   !4, ~15
   13    18        TYPE_CHECK                                    8          !3
         19      > JMPZ                                                     ~17, ->22
         20    >   QM_ASSIGN                                        ~18     !4
         21      > JMP                                                      ->23
         22    >   QM_ASSIGN                                        ~18     !0
         23    >   ECHO                                                     ~18
         24        ECHO                                                     '%0A'
   11    25      > JMP                                                      ->16
         26    >   FE_FREE                                                  $14
    5    27        PRE_INC                                                  !0
         28    >   IS_SMALLER_OR_EQUAL                                      !0, 100
         29      > JMPNZ                                                    ~20, ->2
   15    30    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.79 ms | 1396 KiB | 17 Q