3v4l.org

run code in 500+ PHP versions simultaneously
<?php function printPyramid($rows){ for($i = 1; $i <= $rows; ++$i){ echo str_repeat("&nbsp;", $rows - $i); for($j = $i; $j >= 1; --$j){ echo $j; } for($j = 2; $j <= $i; ++$j){ echo $j; } echo PHP_EOL; } } printPyramid(7);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rLcaH
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                                   'printpyramid'
          1        SEND_VAL                                                     7
          2        DO_FCALL                                          0          
          3      > RETURN                                                       1

Function printpyramid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 3
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 11
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 17
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 3
Branch analysis from position: 25
Branch analysis from position: 3
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 17
Branch analysis from position: 21
Branch analysis from position: 17
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 11
Branch analysis from position: 15
Branch analysis from position: 11
filename:       /in/rLcaH
function name:  printPyramid
number of ops:  26
compiled vars:  !0 = $rows, !1 = $i, !2 = $j
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        ASSIGN                                                       !1, 1
          2      > JMP                                                          ->23
    5     3    >   INIT_FCALL                                                   'str_repeat'
          4        SEND_VAL                                                     '%26nbsp%3B'
          5        SUB                                                  ~4      !0, !1
          6        SEND_VAL                                                     ~4
          7        DO_ICALL                                             $5      
          8        ECHO                                                         $5
    7     9        ASSIGN                                                       !2, !1
         10      > JMP                                                          ->13
    8    11    >   ECHO                                                         !2
    7    12        PRE_DEC                                                      !2
         13    >   IS_SMALLER_OR_EQUAL                                          1, !2
         14      > JMPNZ                                                        ~8, ->11
   11    15    >   ASSIGN                                                       !2, 2
         16      > JMP                                                          ->19
   12    17    >   ECHO                                                         !2
   11    18        PRE_INC                                                      !2
         19    >   IS_SMALLER_OR_EQUAL                                          !2, !1
         20      > JMPNZ                                                        ~11, ->17
   15    21    >   ECHO                                                         '%0A'
    4    22        PRE_INC                                                      !1
         23    >   IS_SMALLER_OR_EQUAL                                          !1, !0
         24      > JMPNZ                                                        ~13, ->3
   17    25    > > RETURN                                                       null

End of function printpyramid

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.87 ms | 1748 KiB | 15 Q