3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myPosts = range(1, 10); $i = null; $breakOn = 3; $rowStart = '<div class="row">' . "\n"; $rowEnd = '</div>' . "\n"; $item = ' <div class="item"></div>' . "\n"; while (array_shift($myPosts)) { if ($i === $breakOn) { echo $rowEnd . $rowStart; $breakOn = 5 - $breakOn; $i = 0; } elseif (!$i) { echo $rowStart; } echo $item; ++$i; } if ($i !== null) { echo $rowEnd; }
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 = 28, Position 2 = 11
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 11
Branch analysis from position: 28
Branch analysis from position: 11
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 11
Branch analysis from position: 28
Branch analysis from position: 11
Branch analysis from position: 22
filename:       /in/qdv52
function name:  (null)
number of ops:  32
compiled vars:  !0 = $myPosts, !1 = $i, !2 = $breakOn, !3 = $rowStart, !4 = $rowEnd, !5 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 10
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !0, $6
    4     5        ASSIGN                                                   !1, null
    5     6        ASSIGN                                                   !2, 3
    6     7        ASSIGN                                                   !3, '%3Cdiv+class%3D%22row%22%3E%0A'
    7     8        ASSIGN                                                   !4, '%3C%2Fdiv%3E%0A'
    8     9        ASSIGN                                                   !5, '++++%3Cdiv+class%3D%22item%22%3E%3C%2Fdiv%3E%0A'
    9    10      > JMP                                                      ->24
   10    11    >   IS_IDENTICAL                                             !1, !2
         12      > JMPZ                                                     ~13, ->19
   11    13    >   CONCAT                                           ~14     !4, !3
         14        ECHO                                                     ~14
   12    15        SUB                                              ~15     5, !2
         16        ASSIGN                                                   !2, ~15
   13    17        ASSIGN                                                   !1, 0
   10    18      > JMP                                                      ->22
   14    19    >   BOOL_NOT                                         ~18     !1
         20      > JMPZ                                                     ~18, ->22
   15    21    >   ECHO                                                     !3
   17    22    >   ECHO                                                     !5
   18    23        PRE_INC                                                  !1
    9    24    >   INIT_FCALL                                               'array_shift'
         25        SEND_REF                                                 !0
         26        DO_ICALL                                         $20     
         27      > JMPNZ                                                    $20, ->11
   20    28    >   TYPE_CHECK                                  1020          !1
         29      > JMPZ                                                     ~21, ->31
   21    30    >   ECHO                                                     !4
   22    31    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.76 ms | 1004 KiB | 15 Q