3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr[] = array("id" => 11, "name" => "First"); $arr[] = array("id" => 52, "name" => "Second"); $arr[] = array("id" => 6, "name" => "Third"); $arr[] = array("id" => 43, "name" => "Fourth"); $find = 43; var_export( array_find($arr, fn($row) => $row['name'] === $find)[$find] ?? null );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/um1M7
function name:  (null)
number of ops:  22
compiled vars:  !0 = $arr, !1 = $find
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN_DIM                                               !0
          1        OP_DATA                                                  <array>
    5     2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  <array>
    6     4        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  <array>
    7     6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  <array>
    9     8        ASSIGN                                                   !1, 43
   10     9        INIT_FCALL                                               'var_export'
   11    10        INIT_FCALL_BY_NAME                                       'array_find'
         11        SEND_VAR_EX                                              !0
         12        DECLARE_LAMBDA_FUNCTION                          ~7      [0]
         13        BIND_LEXICAL                                             ~7, !1
         14        SEND_VAL_EX                                              ~7
         15        DO_FCALL                                      0  $8      
         16        FETCH_DIM_IS                                     ~9      $8, !1
         17        COALESCE                                         ~10     ~9
         18        QM_ASSIGN                                        ~10     null
         19        SEND_VAL                                                 ~10
   10    20        DO_ICALL                                                 
   12    21      > 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/um1M7
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $row, !1 = $find
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        FETCH_DIM_R                                      ~2      !0, 'name'
          3        IS_IDENTICAL                                     ~3      !1, ~2
          4      > RETURN                                                   ~3
          5*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.61 ms | 998 KiB | 14 Q