3v4l.org

run code in 300+ PHP versions simultaneously
<?php function odd($limit){ $row=1; $current_number=1; while($current_number<=$limit){ for($i=1;$i<=$row;$i++){ echo $current_number." "; $current_number=$current_number+2;//incrementing numbers by 2 if you want to increment by 1 i.e print all numbers replace 2 by 1 } $row++; echo "<br/>";//for new line } } odd(20); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1OJRk
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'odd'
          1        SEND_VAL                                                 20
          2        DO_FCALL                                      0          
   15     3      > RETURN                                                   1

Function odd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 4
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 6
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 4
Branch analysis from position: 17
Branch analysis from position: 4
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 6
Branch analysis from position: 13
Branch analysis from position: 6
filename:       /in/1OJRk
function name:  odd
number of ops:  18
compiled vars:  !0 = $limit, !1 = $row, !2 = $current_number, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, 1
    4     2        ASSIGN                                                   !2, 1
    5     3      > JMP                                                      ->15
    6     4    >   ASSIGN                                                   !3, 1
          5      > JMP                                                      ->11
    7     6    >   CONCAT                                           ~7      !2, '+'
          7        ECHO                                                     ~7
    8     8        ADD                                              ~8      !2, 2
          9        ASSIGN                                                   !2, ~8
    6    10        PRE_INC                                                  !3
         11    >   IS_SMALLER_OR_EQUAL                                      !3, !1
         12      > JMPNZ                                                    ~11, ->6
   10    13    >   PRE_INC                                                  !1
   11    14        ECHO                                                     '%3Cbr%2F%3E'
    5    15    >   IS_SMALLER_OR_EQUAL                                      !2, !0
         16      > JMPNZ                                                    ~13, ->4
   13    17    > > RETURN                                                   null

End of function odd

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.78 ms | 1399 KiB | 14 Q