3v4l.org

run code in 300+ PHP versions simultaneously
<?php $record = ["manzana", "pera", "naranja", "mango", "aguacate", "platano", "kiwi", "uva", "mandarina"]; $numRecord = count($record); $showRecord = 2; $page = ceil($numRecord/$showRecord); $star = 1; $getPage = 4; $actualPage = $getPage ?? $star; $previusPage = $actualPage - 1; $nextPage = $actualPage + 1; $from = ($actualPage-1) * $showRecord; $to = ($from + ($showRecord-1)); $numPage = 3; echo "\n\n=============DATOS=============\n\n"; echo "cantidad de registros: $numRecord\n"; echo "registros mostrados por pagina: $showRecord\n"; echo "cantidad de paginas: $page\n"; echo "desde donde se muestran: $from\n"; echo "hasta donde se muestran: $to\n"; echo "pagina actual: $actualPage\n"; echo "pagina anterior: $previusPage\n"; echo "pagina siguiente: $nextPage\n"; echo "numeros de paginas que se muestran: $numPage\n"; echo "\n\n=============REGISTROS=============\n\n"; for($j = $from; $j <= $to; $j++){ if($j < $numRecord) echo " | $record[$j]\t|\n"; } echo "\n\n=============PAGINADO=============\n\n"; if($previusPage > 0){ echo "(principio $star) "; echo "<<|anterior| "; } for($i = $star; $i <= $page; $i++){ if($i == $actualPage) echo " <|$i|> "; else echo " |$i| "; } if($nextPage <= $page){ echo " |siguiente|>>"; echo " (ultimo $page)"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
2 jumps found. (Code = 44) Position 1 = 75, Position 2 = 65
Branch analysis from position: 75
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 83
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 97
Branch analysis from position: 97
2 jumps found. (Code = 44) Position 1 = 99, Position 2 = 85
Branch analysis from position: 99
2 jumps found. (Code = 43) Position 1 = 101, Position 2 = 106
Branch analysis from position: 101
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 106
Branch analysis from position: 85
2 jumps found. (Code = 43) Position 1 = 87, Position 2 = 92
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
2 jumps found. (Code = 44) Position 1 = 99, Position 2 = 85
Branch analysis from position: 99
Branch analysis from position: 85
Branch analysis from position: 92
2 jumps found. (Code = 44) Position 1 = 99, Position 2 = 85
Branch analysis from position: 99
Branch analysis from position: 85
Branch analysis from position: 83
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 72
Branch analysis from position: 67
2 jumps found. (Code = 44) Position 1 = 75, Position 2 = 65
Branch analysis from position: 75
Branch analysis from position: 65
Branch analysis from position: 72
filename:       /in/o8LG1
function name:  (null)
number of ops:  107
compiled vars:  !0 = $record, !1 = $numRecord, !2 = $showRecord, !3 = $page, !4 = $star, !5 = $getPage, !6 = $actualPage, !7 = $previusPage, !8 = $nextPage, !9 = $from, !10 = $to, !11 = $numPage, !12 = $j, !13 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        COUNT                                            ~15     !0
          2        ASSIGN                                                   !1, ~15
    5     3        ASSIGN                                                   !2, 2
    6     4        INIT_FCALL                                               'ceil'
          5        DIV                                              ~18     !1, !2
          6        SEND_VAL                                                 ~18
          7        DO_ICALL                                         $19     
          8        ASSIGN                                                   !3, $19
    7     9        ASSIGN                                                   !4, 1
    8    10        ASSIGN                                                   !5, 4
    9    11        COALESCE                                         ~23     !5
         12        QM_ASSIGN                                        ~23     !4
         13        ASSIGN                                                   !6, ~23
   10    14        SUB                                              ~25     !6, 1
         15        ASSIGN                                                   !7, ~25
   11    16        ADD                                              ~27     !6, 1
         17        ASSIGN                                                   !8, ~27
   12    18        SUB                                              ~29     !6, 1
         19        MUL                                              ~30     !2, ~29
         20        ASSIGN                                                   !9, ~30
   13    21        SUB                                              ~32     !2, 1
         22        ADD                                              ~33     !9, ~32
         23        ASSIGN                                                   !10, ~33
   14    24        ASSIGN                                                   !11, 3
   15    25        ECHO                                                     '%0A%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3DDATOS%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0A'
   16    26        ROPE_INIT                                     3  ~37     'cantidad+de+registros%3A+'
         27        ROPE_ADD                                      1  ~37     ~37, !1
         28        ROPE_END                                      2  ~36     ~37, '%0A'
         29        ECHO                                                     ~36
   17    30        ROPE_INIT                                     3  ~40     'registros+mostrados+por+pagina%3A+'
         31        ROPE_ADD                                      1  ~40     ~40, !2
         32        ROPE_END                                      2  ~39     ~40, '%0A'
         33        ECHO                                                     ~39
   18    34        ROPE_INIT                                     3  ~43     'cantidad+de+paginas%3A+'
         35        ROPE_ADD                                      1  ~43     ~43, !3
         36        ROPE_END                                      2  ~42     ~43, '%0A'
         37        ECHO                                                     ~42
   19    38        ROPE_INIT                                     3  ~46     'desde+donde+se+muestran%3A+'
         39        ROPE_ADD                                      1  ~46     ~46, !9
         40        ROPE_END                                      2  ~45     ~46, '%0A'
         41        ECHO                                                     ~45
   20    42        ROPE_INIT                                     3  ~49     'hasta+donde+se+muestran%3A+'
         43        ROPE_ADD                                      1  ~49     ~49, !10
         44        ROPE_END                                      2  ~48     ~49, '%0A'
         45        ECHO                                                     ~48
   21    46        ROPE_INIT                                     3  ~52     'pagina+actual%3A+'
         47        ROPE_ADD                                      1  ~52     ~52, !6
         48        ROPE_END                                      2  ~51     ~52, '%0A'
         49        ECHO                                                     ~51
   22    50        ROPE_INIT                                     3  ~55     'pagina+anterior%3A+'
         51        ROPE_ADD                                      1  ~55     ~55, !7
         52        ROPE_END                                      2  ~54     ~55, '%0A'
         53        ECHO                                                     ~54
   23    54        ROPE_INIT                                     3  ~58     'pagina+siguiente%3A+'
         55        ROPE_ADD                                      1  ~58     ~58, !8
         56        ROPE_END                                      2  ~57     ~58, '%0A'
         57        ECHO                                                     ~57
   24    58        ROPE_INIT                                     3  ~61     'numeros+de+paginas+que+se+muestran%3A+'
         59        ROPE_ADD                                      1  ~61     ~61, !11
         60        ROPE_END                                      2  ~60     ~61, '%0A'
         61        ECHO                                                     ~60
   26    62        ECHO                                                     '%0A%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3DREGISTROS%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0A'
   27    63        ASSIGN                                                   !12, !9
         64      > JMP                                                      ->73
   28    65    >   IS_SMALLER                                               !12, !1
         66      > JMPZ                                                     ~64, ->72
   29    67    >   ROPE_INIT                                     3  ~67     '+%7C+'
         68        FETCH_DIM_R                                      ~65     !0, !12
         69        ROPE_ADD                                      1  ~67     ~67, ~65
         70        ROPE_END                                      2  ~66     ~67, '%09%7C%0A'
         71        ECHO                                                     ~66
   27    72    >   PRE_INC                                                  !12
         73    >   IS_SMALLER_OR_EQUAL                                      !12, !10
         74      > JMPNZ                                                    ~70, ->65
   33    75    >   ECHO                                                     '%0A%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3DPAGINADO%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0A'
   35    76        IS_SMALLER                                               0, !7
         77      > JMPZ                                                     ~71, ->83
   36    78    >   ROPE_INIT                                     3  ~73     '%28principio+'
         79        ROPE_ADD                                      1  ~73     ~73, !4
         80        ROPE_END                                      2  ~72     ~73, '%29+'
         81        ECHO                                                     ~72
   37    82        ECHO                                                     '%3C%3C%7Canterior%7C+'
   39    83    >   ASSIGN                                                   !13, !4
         84      > JMP                                                      ->97
   40    85    >   IS_EQUAL                                                 !13, !6
         86      > JMPZ                                                     ~76, ->92
   41    87    >   ROPE_INIT                                     3  ~78     '+%3C%7C'
         88        ROPE_ADD                                      1  ~78     ~78, !13
         89        ROPE_END                                      2  ~77     ~78, '%7C%3E+'
         90        ECHO                                                     ~77
         91      > JMP                                                      ->96
   43    92    >   ROPE_INIT                                     3  ~81     '+%7C'
         93        ROPE_ADD                                      1  ~81     ~81, !13
         94        ROPE_END                                      2  ~80     ~81, '%7C+'
         95        ECHO                                                     ~80
   39    96    >   PRE_INC                                                  !13
         97    >   IS_SMALLER_OR_EQUAL                                      !13, !3
         98      > JMPNZ                                                    ~84, ->85
   45    99    >   IS_SMALLER_OR_EQUAL                                      !8, !3
        100      > JMPZ                                                     ~85, ->106
   46   101    >   ECHO                                                     '+%7Csiguiente%7C%3E%3E'
   47   102        ROPE_INIT                                     3  ~87     '+%28ultimo+'
        103        ROPE_ADD                                      1  ~87     ~87, !3
        104        ROPE_END                                      2  ~86     ~87, '%29'
        105        ECHO                                                     ~86
   48   106    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.89 ms | 1396 KiB | 15 Q