3v4l.org

run code in 300+ PHP versions simultaneously
<?php $board = [ ['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i'], ]; /* $flatBoxes = []; $boxIndexes = [0, 3, 6]; $boardLength = count($board[0]); $boxRows = []; for($start = 0; $start < $boardLength; $start += 3) { for($row = 0; $row < $boardLength; $row += 1) { $boxWidth = 3; $boxRow = array_slice($board[$row], $start, $boxWidth); $boxRows[] = $boxRow; } } $boxesList = []; for($start = 0; $start < count($boxRows); $start += 3) { $end = 3; $box = array_slice($boxRows, $start, $end); $boxesList[] = $box; } $boxes = []; for($boxIndex = 0; $boxIndex < count($boxesList); $boxIndex += 1) { $boxList = $boxesList[$boxIndex]; $row = []; for($box = 0; $box < count($boxList); $box += 1) { $choosenBox = $boxList[$box]; for($index = 0; $index < count($choosenBox); $index += 1) { $digit = $choosenBox[$index]; array_push($row, $digit); } } array_push($boxes, $row); }*/ var_export([array_merge(...$board)]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Vg7LD
function name:  (null)
number of ops:  10
compiled vars:  !0 = $board
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   42     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'array_merge'
          3        SEND_UNPACK                                              !0
          4        CHECK_UNDEF_ARGS                                         
          5        DO_ICALL                                         $2      
          6        INIT_ARRAY                                       ~3      $2
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.45 ms | 999 KiB | 15 Q