3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits = [ ['name' => 'banana', 'color' => 'yellow' , 'shape' => 'cylinder'], ['name' => 'apple', 'color' => 'red' , 'shape' => 'sphere'], ['name' => 'orange', 'color' => 'orange' , 'shape' => 'sphere'], ]; var_export( array_any( $fruits, fn($row) => $row['name'] === 'apple' ) ); echo "\n---\n"; var_export( array_all( $fruits, fn($row) => $row['name'] === 'apple' ) ); echo "\n---\n"; var_export( array_find_key( $fruits, fn($row) => $row['name'] === 'apple' ) ); echo "\n---\n"; var_export( array_find( $fruits, fn($row) => $row['name'] === 'apple' ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FXYeo
function name:  (null)
number of ops:  37
compiled vars:  !0 = $fruits
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'var_export'
   10     2        INIT_FCALL_BY_NAME                                       'array_any'
   11     3        SEND_VAR_EX                                              !0
   12     4        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   13     5        SEND_VAL_EX                                              ~2
   10     6        DO_FCALL                                      0  $3      
   13     7        SEND_VAR                                                 $3
    9     8        DO_ICALL                                                 
   16     9        ECHO                                                     '%0A---%0A'
   18    10        INIT_FCALL                                               'var_export'
   19    11        INIT_FCALL_BY_NAME                                       'array_all'
   20    12        SEND_VAR_EX                                              !0
   21    13        DECLARE_LAMBDA_FUNCTION                          ~5      [1]
   22    14        SEND_VAL_EX                                              ~5
   19    15        DO_FCALL                                      0  $6      
   22    16        SEND_VAR                                                 $6
   18    17        DO_ICALL                                                 
   25    18        ECHO                                                     '%0A---%0A'
   27    19        INIT_FCALL                                               'var_export'
   28    20        INIT_FCALL_BY_NAME                                       'array_find_key'
   29    21        SEND_VAR_EX                                              !0
   30    22        DECLARE_LAMBDA_FUNCTION                          ~8      [2]
   31    23        SEND_VAL_EX                                              ~8
   28    24        DO_FCALL                                      0  $9      
   31    25        SEND_VAR                                                 $9
   27    26        DO_ICALL                                                 
   34    27        ECHO                                                     '%0A---%0A'
   36    28        INIT_FCALL                                               'var_export'
   37    29        INIT_FCALL_BY_NAME                                       'array_find'
   38    30        SEND_VAR_EX                                              !0
   39    31        DECLARE_LAMBDA_FUNCTION                          ~11     [3]
   40    32        SEND_VAL_EX                                              ~11
   37    33        DO_FCALL                                      0  $12     
   40    34        SEND_VAR                                                 $12
   36    35        DO_ICALL                                                 
   41    36      > 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/FXYeo
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 'name'
          2        IS_IDENTICAL                                     ~2      ~1, 'apple'
          3      > RETURN                                                   ~2
   13     4*     > RETURN                                                   null

End of Dynamic Function 0

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

End of Dynamic Function 1

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

End of Dynamic Function 2

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

End of Dynamic Function 3

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.78 ms | 1015 KiB | 14 Q