3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Say we have a 74-page file $num_pages = 74; // Fill an array of commands. $sections = array(); for ($i = 1; $i <= $num_pages; $i = $i+2) { $next = $i+1; $sections[] = "pdftk A=the.pdf cat A{$i}-{$next} output the_pages_{$i}-{$next}.pdf"; // Or, y'know, run them directly with shell_exec or something. // shell_exec("pdftk A=the.pdf cat A{$i}-{$next} output the_pages_{$i}-{$next}.pdf"); } print_r($sections); // Then of course run them all.
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 4
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 4
Branch analysis from position: 21
Branch analysis from position: 4
filename:       /in/q83fh
function name:  (null)
number of ops:  25
compiled vars:  !0 = $num_pages, !1 = $sections, !2 = $i, !3 = $next
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 74
    7     1        ASSIGN                                                   !1, <array>
    9     2        ASSIGN                                                   !2, 1
          3      > JMP                                                      ->19
   10     4    >   ADD                                              ~7      !2, 1
          5        ASSIGN                                                   !3, ~7
   11     6        ROPE_INIT                                     9  ~11     'pdftk+A%3Dthe.pdf+cat+A'
          7        ROPE_ADD                                      1  ~11     ~11, !2
          8        ROPE_ADD                                      2  ~11     ~11, '-'
          9        ROPE_ADD                                      3  ~11     ~11, !3
         10        ROPE_ADD                                      4  ~11     ~11, '+output+the_pages_'
         11        ROPE_ADD                                      5  ~11     ~11, !2
         12        ROPE_ADD                                      6  ~11     ~11, '-'
         13        ROPE_ADD                                      7  ~11     ~11, !3
         14        ROPE_END                                      8  ~10     ~11, '.pdf'
         15        ASSIGN_DIM                                               !1
         16        OP_DATA                                                  ~10
    9    17        ADD                                              ~16     !2, 2
         18        ASSIGN                                                   !2, ~16
         19    >   IS_SMALLER_OR_EQUAL                                      !2, !0
         20      > JMPNZ                                                    ~18, ->4
   16    21    >   INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
   18    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.41 ms | 1395 KiB | 15 Q