3v4l.org

run code in 300+ PHP versions simultaneously
<?php $img=array( array("iamge"=>"1234_asd.jpg"), array("iamge"=>"1235_ase.jpg"), array("iamge"=>"1236_asf.jpg") ); $imgArr=array( array("iamgename"=>"1234_asd.jpg"), array("iamgename"=>"1235_ase.jpg"), array("iamgename"=>"1236_asf.jpg"), array("iamgename"=>"1237_asg.jpg") ); function bjsearch($img, $seachimg){ $result = true; if(!in_array($seachimg, $img)){ $result = false; } return $result; } $found = true; $image_name = ''; foreach($imgArr as $k=>$im){ $seachInArr = isset($img[$k]) ? $img[$k] : array(); $res = bjsearch($seachInArr, $im['iamgename']); if($res === false){ $found = false; $image_name = $im['iamgename']; } } var_dump($found, $image_name);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 26
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 26
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 25
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
Branch analysis from position: 25
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/vkAF4
function name:  (null)
number of ops:  32
compiled vars:  !0 = $img, !1 = $imgArr, !2 = $found, !3 = $image_name, !4 = $im, !5 = $k, !6 = $seachInArr, !7 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   23     2        ASSIGN                                                   !2, <true>
   24     3        ASSIGN                                                   !3, ''
   25     4      > FE_RESET_R                                       $12     !1, ->26
          5    > > FE_FETCH_R                                       ~13     $12, !4, ->26
          6    >   ASSIGN                                                   !5, ~13
   26     7        ISSET_ISEMPTY_DIM_OBJ                         0          !0, !5
          8      > JMPZ                                                     ~15, ->12
          9    >   FETCH_DIM_R                                      ~16     !0, !5
         10        QM_ASSIGN                                        ~17     ~16
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~17     <array>
         13    >   ASSIGN                                                   !6, ~17
   27    14        INIT_FCALL                                               'bjsearch'
         15        SEND_VAR                                                 !6
         16        FETCH_DIM_R                                      ~19     !4, 'iamgename'
         17        SEND_VAL                                                 ~19
         18        DO_FCALL                                      0  $20     
         19        ASSIGN                                                   !7, $20
   28    20        TYPE_CHECK                                    4          !7
         21      > JMPZ                                                     ~22, ->25
   29    22    >   ASSIGN                                                   !2, <false>
   30    23        FETCH_DIM_R                                      ~24     !4, 'iamgename'
         24        ASSIGN                                                   !3, ~24
   25    25    > > JMP                                                      ->5
         26    >   FE_FREE                                                  $12
   33    27        INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !2
         29        SEND_VAR                                                 !3
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Function bjsearch:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/vkAF4
function name:  bjsearch
number of ops:  12
compiled vars:  !0 = $img, !1 = $seachimg, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        ASSIGN                                                   !2, <true>
   16     3        INIT_FCALL                                               'in_array'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        BOOL_NOT                                         ~5      $4
          8      > JMPZ                                                     ~5, ->10
   17     9    >   ASSIGN                                                   !2, <false>
   19    10    > > RETURN                                                   !2
   20    11*     > RETURN                                                   null

End of function bjsearch

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.29 ms | 1416 KiB | 18 Q