3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ (object) ['id' => 'one', 'color' => 'white'], (object) ['id' => 'two', 'color' => 'red'], (object) ['id' => 'three', 'color' => 'blue'] ]; $find = 'one'; var_export( array_find( $array, fn($row) => $row->id === $find ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/llvFp
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array, !1 = $find
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   CAST                                              8  ~2      <array>
          1        INIT_ARRAY                                           ~3      ~2
          2        CAST                                              8  ~4      <array>
          3        ADD_ARRAY_ELEMENT                                    ~3      ~4
          4        CAST                                              8  ~5      <array>
          5        ADD_ARRAY_ELEMENT                                    ~3      ~5
    3     6        ASSIGN                                                       !0, ~3
    9     7        ASSIGN                                                       !1, 'one'
   11     8        INIT_FCALL                                                   'var_export'
   12     9        INIT_FCALL                                                   'array_find'
   13    10        SEND_VAR                                                     !0
   14    11        DECLARE_LAMBDA_FUNCTION                              ~8      [0]
         12        BIND_LEXICAL                                                 ~8, !1
   15    13        SEND_VAL                                                     ~8
   12    14        DO_ICALL                                             $9      
   15    15        SEND_VAR                                                     $9
   11    16        DO_ICALL                                                     
   16    17      > 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/llvFp
function name:  {closure:/in/llvFp:14}
number of ops:  6
compiled vars:  !0 = $row, !1 = $find
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        FETCH_OBJ_R                                          ~2      !0, 'id'
          3        IS_IDENTICAL                                         ~3      !1, ~2
          4      > RETURN                                                       ~3
   15     5*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.52 ms | 1469 KiB | 16 Q