3v4l.org

run code in 300+ PHP versions simultaneously
<?php $search=array("<",">","!=","<=",">="); $value = "name ** vivek "; function test($item, $key, $arr) { static $found; static $matches; $str = $arr[0]; $count = $arr[1]; if( strpos($str, $item) !== FALSE ) { $found++; $matches .= $item . " "; } if ($count == $key + 1){ echo "$found search item(s) found in \"$str\": $matches\n"; } } array_walk($search, 'test', array( $value, count($search) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EjHkS
function name:  (null)
number of ops:  11
compiled vars:  !0 = $search, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'name+%2A%2A+vivek+'
   23     2        INIT_FCALL                                               'array_walk'
          3        SEND_REF                                                 !0
          4        SEND_VAL                                                 'test'
          5        INIT_ARRAY                                       ~4      !1
          6        COUNT                                            ~5      !0
          7        ADD_ARRAY_ELEMENT                                ~4      ~5
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 18
filename:       /in/EjHkS
function name:  test
number of ops:  29
compiled vars:  !0 = $item, !1 = $key, !2 = $arr, !3 = $found, !4 = $matches, !5 = $str, !6 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    8     3        BIND_STATIC                                              !3
    9     4        BIND_STATIC                                              !4
   11     5        FETCH_DIM_R                                      ~7      !2, 0
          6        ASSIGN                                                   !5, ~7
   12     7        FETCH_DIM_R                                      ~9      !2, 1
          8        ASSIGN                                                   !6, ~9
   14     9        INIT_FCALL                                               'strpos'
         10        SEND_VAR                                                 !5
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $11     
         13        TYPE_CHECK                                  1018          $11
         14      > JMPZ                                                     ~12, ->18
   15    15    >   PRE_INC                                                  !3
   16    16        CONCAT                                           ~14     !0, '+'
         17        ASSIGN_OP                                     8          !4, ~14
   18    18    >   ADD                                              ~16     !1, 1
         19        IS_EQUAL                                                 !6, ~16
         20      > JMPZ                                                     ~17, ->28
   19    21    >   ROPE_INIT                                     6  ~19     !3
         22        ROPE_ADD                                      1  ~19     ~19, '+search+item%28s%29+found+in+%22'
         23        ROPE_ADD                                      2  ~19     ~19, !5
         24        ROPE_ADD                                      3  ~19     ~19, '%22%3A+'
         25        ROPE_ADD                                      4  ~19     ~19, !4
         26        ROPE_END                                      5  ~18     ~19, '%0A'
         27        ECHO                                                     ~18
   21    28    > > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.44 ms | 1400 KiB | 17 Q