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; array_push($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 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 9
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 9
Branch analysis from position: 28
Branch analysis from position: 9
filename:       /in/btHKo
function name:  (null)
number of ops:  32
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                                                      ->26
   11     9    >   ADD                                              ~10     !3, 1
         10        ASSIGN                                                   !4, ~10
   12    11        INIT_FCALL                                               'array_push'
         12        SEND_REF                                                 !2
         13        ROPE_INIT                                     9  ~13     'pdftk+A%3Dthe.pdf+cat+A'
         14        ROPE_ADD                                      1  ~13     ~13, !3
         15        ROPE_ADD                                      2  ~13     ~13, '-'
         16        ROPE_ADD                                      3  ~13     ~13, !4
         17        ROPE_ADD                                      4  ~13     ~13, '+output+the_pages_'
         18        ROPE_ADD                                      5  ~13     ~13, !3
         19        ROPE_ADD                                      6  ~13     ~13, '-'
         20        ROPE_ADD                                      7  ~13     ~13, !4
         21        ROPE_END                                      8  ~12     ~13, '.pdf'
         22        SEND_VAL                                                 ~12
         23        DO_ICALL                                                 
   10    24        ADD                                              ~19     !3, 2
         25        ASSIGN                                                   !3, ~19
         26    >   IS_SMALLER_OR_EQUAL                                      !3, !1
         27      > JMPNZ                                                    ~21, ->9
   15    28    >   INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.91 ms | 1396 KiB | 19 Q