3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class SudokuSolver { protected $sudoku; public function __construct(array $sudoku) { $this->sudoku = $sudoku; } public function print() { foreach ($this->sudoku as $column) { foreach ($column as $cell) { echo "|"; if (null !== $cell) { echo $cell; } else { echo " "; } } echo "|\n"; } } protected function checkConsistenz() { } protected function checkRow($rowIndex) { } } $sudoku = array(); $sudoku[] = array(null,3,null, null,null,null, null,null,null); $sudoku[] = array(null,null,null, 1,9,5, null,null,null); $sudoku[] = array(null,null,8, null,null,null, null,6,null); $sudoku[] = array(8,null,null, null,6,null, null,null,null); $sudoku[] = array(4,null,null, 8,null,null, null,null,1); $sudoku[] = array(null,null,null ,null,2,null, null,null,null); $sudoku[] = array(null,6,null, null,null,null, 2,8,null); $sudoku[] = array(null,null,null, 4,1,9, null,null,5); $sudoku[] = array(null,null,null, null,null,null, null,7,null); $sudokuSolver = new SudokuSolver($sudoko); $sudokuSolver->print();
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/7a7Ya
function name:  (null)
number of ops:  27
compiled vars:  !0 = $sudoku, !1 = $sudokuSolver, !2 = $sudoko
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  39     1        ASSIGN                                                   !0, <array>
  40     2        ASSIGN_DIM                                               !0
         3        OP_DATA                                                  <array>
  41     4        ASSIGN_DIM                                               !0
         5        OP_DATA                                                  <array>
  42     6        ASSIGN_DIM                                               !0
         7        OP_DATA                                                  <array>
  43     8        ASSIGN_DIM                                               !0
         9        OP_DATA                                                  <array>
  44    10        ASSIGN_DIM                                               !0
        11        OP_DATA                                                  <array>
  45    12        ASSIGN_DIM                                               !0
        13        OP_DATA                                                  <array>
  46    14        ASSIGN_DIM                                               !0
        15        OP_DATA                                                  <array>
  47    16        ASSIGN_DIM                                               !0
        17        OP_DATA                                                  <array>
  48    18        ASSIGN_DIM                                               !0
        19        OP_DATA                                                  <array>
  50    20        NEW                                              $14     :5
        21        SEND_VAR_EX                                              !2
        22        DO_FCALL                                      0          
        23        ASSIGN                                                   !1, $14
  51    24        INIT_METHOD_CALL                                         !1, 'print'
        25        DO_FCALL                                      0          
        26      > RETURN                                                   1

Class SudokuSolver:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/7a7Ya
function name:  __construct
number of ops:  4
compiled vars:  !0 = $sudoku
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   7     0  E >   RECV                                             !0      
   9     1        ASSIGN_OBJ                                               'sudoku'
         2        OP_DATA                                                  !0
  10     3      > RETURN                                                   null

End of function __construct

Function print:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
Jump found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
Jump found. (Code = 77) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
Jump found. (Code = 78) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
Jump found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
Jump found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Jump found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
Jump found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
Jump found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
Branch analysis from position: 15
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/7a7Ya
function name:  print
number of ops:  17
compiled vars:  !0 = $column, !1 = $cell
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  15     0  E >   FETCH_OBJ_R                                      $2      'sudoku'
         1      > FE_RESET_R                                       $3      $2, ->15
         2    > > FE_FETCH_R                                               $3, !0, ->15
  16     3    > > FE_RESET_R                                       $4      !0, ->12
         4    > > FE_FETCH_R                                               $4, !1, ->12
  17     5    >   ECHO                                                     '%7C'
  18     6        IS_NOT_IDENTICAL                                 ~5      null, !1
         7      > JMPZ                                                     ~5, ->10
  19     8    >   ECHO                                                     !1
         9      > JMP                                                      ->11
  21    10    >   ECHO                                                     '+'
        11    > > JMP                                                      ->4
        12    >   FE_FREE                                                  $4
  24    13        ECHO                                                     '%7C%0A'
        14      > JMP                                                      ->2
        15    >   FE_FREE                                                  $3
  26    16      > RETURN                                                   null

End of function print

Function checkconsistenz:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/7a7Ya
function name:  checkConsistenz
number of ops:  1
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  30     0  E > > RETURN                                                   null

End of function checkconsistenz

Function checkrow:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/7a7Ya
function name:  checkRow
number of ops:  2
compiled vars:  !0 = $rowIndex
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  32     0  E >   RECV                                             !0      
  35     1      > RETURN                                                   null

End of function checkrow

End of class SudokuSolver.

Generated using Vulcan Logic Dumper, using php 7.2.0