3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lookup = [ ['a', 'ape'], ['b', 'bee'], ['a', 'ant'], ['d', 'dog'], ['b', 'bat'], ['a', 'asp'], ]; function getValueAt($lookup, $rowIndex, $columnIndex) { return $lookup[$rowIndex][$columnIndex]; } $columnIndex = 0; $values = []; for ($i = 0; $i < count($lookup); ++$i) { $values[getValueAt($lookup, $i, $columnIndex)][] = $i; } var_export($values); echo "\n"; $onlyRecurringRows = array_filter($values, fn($row) => count($row) > 1); var_export($onlyRecurringRows);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 5
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 5
Branch analysis from position: 17
Branch analysis from position: 5
filename:       /in/GCnUN
function name:  (null)
number of ops:  31
compiled vars:  !0 = $lookup, !1 = $columnIndex, !2 = $values, !3 = $i, !4 = $onlyRecurringRows
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   17     1        ASSIGN                                                   !1, 0
   19     2        ASSIGN                                                   !2, <array>
   20     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->14
   21     5    >   INIT_FCALL                                               'getvalueat'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !3
          8        SEND_VAR                                                 !1
          9        DO_FCALL                                      0  $9      
         10        FETCH_DIM_W                                      $10     !2, $9
         11        ASSIGN_DIM                                               $10
         12        OP_DATA                                                  !3
   20    13        PRE_INC                                                  !3
         14    >   COUNT                                            ~13     !0
         15        IS_SMALLER                                               !3, ~13
         16      > JMPNZ                                                    ~14, ->5
   23    17    >   INIT_FCALL                                               'var_export'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   24    20        ECHO                                                     '%0A'
   26    21        INIT_FCALL                                               'array_filter'
         22        SEND_VAR                                                 !2
         23        DECLARE_LAMBDA_FUNCTION                          ~16     [0]
         24        SEND_VAL                                                 ~16
         25        DO_ICALL                                         $17     
         26        ASSIGN                                                   !4, $17
   27    27        INIT_FCALL                                               'var_export'
         28        SEND_VAR                                                 !4
         29        DO_ICALL                                                 
         30      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GCnUN
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        COUNT                                            ~1      !0
          2        IS_SMALLER                                       ~2      1, ~1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of Dynamic Function 0

Function getvalueat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GCnUN
function name:  getValueAt
number of ops:  7
compiled vars:  !0 = $lookup, !1 = $rowIndex, !2 = $columnIndex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   14     3        FETCH_DIM_R                                      ~3      !0, !1
          4        FETCH_DIM_R                                      ~4      ~3, !2
          5      > RETURN                                                   ~4
   15     6*     > RETURN                                                   null

End of function getvalueat

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.93 ms | 1019 KiB | 16 Q