3v4l.org

run code in 500+ PHP versions simultaneously
<?php $animal = array('lion','elephant','tiger'); $search = 'io'; $res = array_filter($animal, function($v, $k) use($search){ return strpos($v, $search); }, ARRAY_FILTER_USE_BOTH); echo '<pre>'; print_r($res);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bdDSF
function name:  (null)
number of ops:  15
compiled vars:  !0 = $animal, !1 = $search, !2 = $res
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    3     1        ASSIGN                                                       !1, 'io'
    4     2        INIT_FCALL                                                   'array_filter'
          3        SEND_VAR                                                     !0
          4        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          5        BIND_LEXICAL                                                 ~5, !1
    6     6        SEND_VAL                                                     ~5
          7        SEND_VAL                                                     1
    4     8        DO_ICALL                                             $6      
          9        ASSIGN                                                       !2, $6
    7    10        ECHO                                                         '%3Cpre%3E'
    8    11        INIT_FCALL                                                   'print_r'
         12        SEND_VAR                                                     !2
         13        DO_ICALL                                                     
         14      > 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/bdDSF
function name:  {closure:/in/bdDSF:4}
number of ops:  6
compiled vars:  !0 = $v, !1 = $k, !2 = $search
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
    5     3        FRAMELESS_ICALL_2                strpos              ~3      !0, !2
          4      > RETURN                                                       ~3
    6     5*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.37 ms | 2019 KiB | 15 Q