3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generatePattern($n) { // Assure-toi que l'entrée est un nombre entier if (!is_int($n) || $n <= 0) { return "Veuillez entrer un nombre entier positif."; } // Boucle pour générer chaque ligne for ($i = $n; $i >= 1; $i--) { // Génère une ligne avec le chiffre $n répété $i fois echo str_repeat($n, $i) . PHP_EOL; } } generatePattern(2); echo "\n"; generatePattern(3); echo "\n"; generatePattern(4); echo "\n"; generatePattern(5);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sWNNT
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'generatepattern'
          1        SEND_VAL                                                 2
          2        DO_FCALL                                      0          
   17     3        ECHO                                                     '%0A'
   18     4        INIT_FCALL                                               'generatepattern'
          5        SEND_VAL                                                 3
          6        DO_FCALL                                      0          
   19     7        ECHO                                                     '%0A'
   20     8        INIT_FCALL                                               'generatepattern'
          9        SEND_VAL                                                 4
         10        DO_FCALL                                      0          
   21    11        ECHO                                                     '%0A'
   22    12        INIT_FCALL                                               'generatepattern'
         13        SEND_VAL                                                 5
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Function generatepattern:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 10
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 10
Branch analysis from position: 19
Branch analysis from position: 10
Branch analysis from position: 6
filename:       /in/sWNNT
function name:  generatePattern
number of ops:  20
compiled vars:  !0 = $n, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        TYPE_CHECK                                   16  ~2      !0
          2        BOOL_NOT                                         ~3      ~2
          3      > JMPNZ_EX                                         ~3      ~3, ->6
          4    >   IS_SMALLER_OR_EQUAL                              ~4      !0, 0
          5        BOOL                                             ~3      ~4
          6    > > JMPZ                                                     ~3, ->8
    6     7    > > RETURN                                                   'Veuillez+entrer+un+nombre+entier+positif.'
   10     8    >   ASSIGN                                                   !1, !0
          9      > JMP                                                      ->17
   12    10    >   INIT_FCALL                                               'str_repeat'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $6      
         14        CONCAT                                           ~7      $6, '%0A'
         15        ECHO                                                     ~7
   10    16        PRE_DEC                                                  !1
         17    >   IS_SMALLER_OR_EQUAL                                      1, !1
         18      > JMPNZ                                                    ~9, ->10
   14    19    > > RETURN                                                   null

End of function generatepattern

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.12 ms | 1444 KiB | 18 Q