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"; } print_r($sections);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 9
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 9
Branch analysis from position: 26
Branch analysis from position: 9
filename:       /in/0Wglm
function name:  (null)
number of ops:  30
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                                                      ->24
   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
   10    22        ADD                                              ~19     !3, 2
         23        ASSIGN                                                   !3, ~19
         24    >   IS_SMALLER_OR_EQUAL                                      !3, !1
         25      > JMPNZ                                                    ~21, ->9
   15    26    >   INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.44 ms | 1396 KiB | 17 Q