3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Say we have a 74-page file $num_pages = 74; // Fill and array. $pages = range(1, $num_pages); $sections = array(); for ($i = 1; $i <= $pages; $i = $i+2) { $next = $i+1; $sections[] = "pdftk A=the.pdf cat A{$i}-{$next} output the_pages_{$i}-{$next}.pdf"; if ($i > 50) { break; } } print_r($sections);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 9
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 25
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 9
Branch analysis from position: 29
Branch analysis from position: 9
filename:       /in/dVF6S
function name:  (null)
number of ops:  33
compiled vars:  !0 = $num_pages, !1 = $pages, !2 = $sections, !3 = $i, !4 = $next
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 74
    7     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 1
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    8     6        ASSIGN                                                   !2, <array>
   10     7        ASSIGN                                                   !3, 1
          8      > JMP                                                      ->27
   11     9    >   ADD                                              ~10     !3, 1
         10        ASSIGN                                                   !4, ~10
   12    11        ROPE_INIT                                     9  ~14     'pdftk+A%3Dthe.pdf+cat+A'
         12        ROPE_ADD                                      1  ~14     ~14, !3
         13        ROPE_ADD                                      2  ~14     ~14, '-'
         14        ROPE_ADD                                      3  ~14     ~14, !4
         15        ROPE_ADD                                      4  ~14     ~14, '+output+the_pages_'
         16        ROPE_ADD                                      5  ~14     ~14, !3
         17        ROPE_ADD                                      6  ~14     ~14, '-'
         18        ROPE_ADD                                      7  ~14     ~14, !4
         19        ROPE_END                                      8  ~13     ~14, '.pdf'
         20        ASSIGN_DIM                                               !2
         21        OP_DATA                                                  ~13
   14    22        IS_SMALLER                                               50, !3
         23      > JMPZ                                                     ~19, ->25
   15    24    > > JMP                                                      ->29
   10    25    >   ADD                                              ~20     !3, 2
         26        ASSIGN                                                   !3, ~20
         27    >   IS_SMALLER_OR_EQUAL                                      !3, !1
         28      > JMPNZ                                                    ~22, ->9
   19    29    >   INIT_FCALL                                               'print_r'
         30        SEND_VAR                                                 !2
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.53 ms | 1396 KiB | 17 Q