3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "This is a string"; $words = explode(' ', $string); $pairs = []; for ($x = 0; $x < (count($words) -1); $x++) { $pairs[$x] = $words[$x] .' ' . $words[$x + 1]; } var_dump($pairs);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 9
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 9
Branch analysis from position: 21
Branch analysis from position: 9
filename:       /in/8r2sn
function name:  (null)
number of ops:  25
compiled vars:  !0 = $string, !1 = $words, !2 = $pairs, !3 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'This+is+a+string'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '+'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    6     6        ASSIGN                                                   !2, <array>
    8     7        ASSIGN                                                   !3, 0
          8      > JMP                                                      ->17
    9     9    >   FETCH_DIM_R                                      ~10     !1, !3
         10        CONCAT                                           ~11     ~10, '+'
         11        ADD                                              ~12     !3, 1
         12        FETCH_DIM_R                                      ~13     !1, ~12
         13        CONCAT                                           ~14     ~11, ~13
         14        ASSIGN_DIM                                               !2, !3
         15        OP_DATA                                                  ~14
    8    16        PRE_INC                                                  !3
         17    >   COUNT                                            ~16     !1
         18        SUB                                              ~17     ~16, 1
         19        IS_SMALLER                                               !3, ~17
         20      > JMPNZ                                                    ~18, ->9
   12    21    >   INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.16 ms | 1011 KiB | 15 Q