3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checkname($arr, $name) { foreach (array_slice(func_get_args(), 1) as $name) { if (strpos($arr, $name) !== false) { return $name; } } return ''; } $autoName=json_decode('["image1","image3","image2","stores1","stores2","stores2","stores3","stores4","design1","design2"]',true); echo call_user_func_array("checkname",array_merge(array("image123456"),$autoName));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dLpD8
function name:  (null)
number of ops:  15
compiled vars:  !0 = $autoName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%5B%22image1%22%2C%22image3%22%2C%22image2%22%2C%22stores1%22%2C%22stores2%22%2C%22stores2%22%2C%22stores3%22%2C%22stores4%22%2C%22design1%22%2C%22design2%22%5D'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
   13     5        INIT_FCALL                                               'checkname'
          6        INIT_FCALL                                               'array_merge'
          7        SEND_VAL                                                 <array>
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $3      
         10        SEND_ARRAY                                               $3
         11        CHECK_UNDEF_ARGS                                         
         12        DO_FCALL                                      0  $4      
         13        ECHO                                                     $4
         14      > RETURN                                                   1

Function checkname:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/dLpD8
function name:  checkname
number of ops:  17
compiled vars:  !0 = $arr, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        FUNC_GET_ARGS                                    ~2      1
          3      > FE_RESET_R                                       $3      ~2, ->14
          4    > > FE_FETCH_R                                               $3, !1, ->14
    4     5    >   INIT_FCALL                                               'strpos'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $4      
          9        TYPE_CHECK                                  1018          $4
         10      > JMPZ                                                     ~5, ->13
    5    11    >   FE_FREE                                                  $3
         12      > RETURN                                                   !1
    3    13    > > JMP                                                      ->4
         14    >   FE_FREE                                                  $3
    8    15      > RETURN                                                   ''
    9    16*     > RETURN                                                   null

End of function checkname

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.52 ms | 1399 KiB | 20 Q