3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testArray = [ [1, 2, "file1.png"], [1, 3, "file2.png"], [1, 4, "file3.png"], ]; $coords = [1, 3]; echo array_find( $testArray, fn($row) => $coords === [$row[0], $row[1]] )[2] ?? 'Not Found';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jE4IU
function name:  (null)
number of ops:  13
compiled vars:  !0 = $testArray, !1 = $coords
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   10     2        INIT_FCALL_BY_NAME                                       'array_find'
   11     3        SEND_VAR_EX                                              !0
   12     4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !1
   13     6        SEND_VAL_EX                                              ~4
   10     7        DO_FCALL                                      0  $5      
   13     8        FETCH_DIM_IS                                     ~6      $5, 2
          9        COALESCE                                         ~7      ~6
         10        QM_ASSIGN                                        ~7      'Not+Found'
         11        ECHO                                                     ~7
         12      > 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/jE4IU
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $row, !1 = $coords
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        FETCH_DIM_R                                      ~2      !0, 0
          3        INIT_ARRAY                                       ~3      ~2
          4        FETCH_DIM_R                                      ~4      !0, 1
          5        ADD_ARRAY_ELEMENT                                ~3      ~4
          6        IS_IDENTICAL                                     ~5      !1, ~3
          7      > RETURN                                                   ~5
   13     8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.41 ms | 1012 KiB | 13 Q