3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [2,4,8,11,12,13,14,15,16,17,18,19,20]; $b = [3,14]; var_export( array_any( $a, function($v) use ($b) { echo "checking if $v in the \$b array\n"; return in_array($v, $b); } ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N4oVe
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'var_export'
    8     3        INIT_FCALL_BY_NAME                                       'array_any'
    9     4        SEND_VAR_EX                                              !0
   10     5        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          6        BIND_LEXICAL                                             ~4, !1
   13     7        SEND_VAL_EX                                              ~4
    8     8        DO_FCALL                                      0  $5      
   13     9        SEND_VAR                                                 $5
    7    10        DO_ICALL                                                 
   15    11      > 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/N4oVe
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $v, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   11     2        ROPE_INIT                                     3  ~3      'checking+if+'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '+in+the+%24b+array%0A'
          5        ECHO                                                     ~2
   12     6        INIT_FCALL                                               'in_array'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $5      
         10      > RETURN                                                   $5
   13    11*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.68 ms | 1003 KiB | 15 Q