3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = /*Your array which you want to split*/ $result = []; $arr = array(['description1'], ['description2'], 'description3', 'description4', 'description5'); //example array_walk_recursive($arr, function($v, $k)use(&$result){ $result[] = $v; }); $result = array_chunk($result, 2); foreach($result as $v) { echo "<div>" . implode(" ", $v) . "</div>"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 24
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 24
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/BBQie
function name:  (null)
number of ops:  26
compiled vars:  !0 = $arr, !1 = $result, !2 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                           ~3      !1, <array>
    3     1        ASSIGN                                                   !0, ~3
    6     2        ASSIGN                                                   !0, <array>
    7     3        INIT_FCALL                                               'array_walk_recursive'
          4        SEND_REF                                                 !0
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBBQie%3A7%240'
          6        BIND_LEXICAL                                             ~6, !1
    9     7        SEND_VAL                                                 ~6
          8        DO_ICALL                                                 
   10     9        INIT_FCALL                                               'array_chunk'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 2
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !1, $8
   12    14      > FE_RESET_R                                       $10     !1, ->24
         15    > > FE_FETCH_R                                               $10, !2, ->24
   13    16    >   INIT_FCALL                                               'implode'
         17        SEND_VAL                                                 '+'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $11     
         20        CONCAT                                           ~12     '%3Cdiv%3E', $11
         21        CONCAT                                           ~13     ~12, '%3C%2Fdiv%3E'
         22        ECHO                                                     ~13
   12    23      > JMP                                                      ->15
         24    >   FE_FREE                                                  $10
   14    25      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FBBQie%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BBQie
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $v, !1 = $k, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    8     3        ASSIGN_DIM                                               !2
          4        OP_DATA                                                  !0
    9     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FBBQie%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.51 ms | 1396 KiB | 19 Q