3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar1= [(object)['id_of'=>1, 'val'=>'rwer']]; $ar2= [ (object)['id'=>1, 'val'=>'rwer'], (object)['id'=>2, 'val'=>'rwer'], (object)['id'=>3, 'val'=>'rwer'] ]; /* foreach($ar1 as $obj1){ foreach($ar2 as $obj2){ if ($obj1->id_of !== $obj2->id) $robjs[] = $obj2; } } */ function unanswered($array1,$array2){ if(!(empty($array2))){ $unanswered_arrays=array(); foreach($array1 as $b){ foreach($array2 as $a){ if($b->id != $a->id_of){ array_push($unanswered_arrays,(object)$b); } } } return $unanswered_arrays; } return $array1; } print_r(unanswered($ar2,$ar1)); //print_r($robjs);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TqN3Y
function name:  (null)
number of ops:  18
compiled vars:  !0 = $ar1, !1 = $ar2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   CAST                                          8  ~2      <array>
          1        INIT_ARRAY                                       ~3      ~2
          2        ASSIGN                                                   !0, ~3
    5     3        CAST                                          8  ~5      <array>
          4        INIT_ARRAY                                       ~6      ~5
    6     5        CAST                                          8  ~7      <array>
          6        ADD_ARRAY_ELEMENT                                ~6      ~7
    7     7        CAST                                          8  ~8      <array>
          8        ADD_ARRAY_ELEMENT                                ~6      ~8
    5     9        ASSIGN                                                   !1, ~6
   32    10        INIT_FCALL                                               'print_r'
         11        INIT_FCALL                                               'unanswered'
         12        SEND_VAR                                                 !1
         13        SEND_VAR                                                 !0
         14        DO_FCALL                                      0  $10     
         15        SEND_VAR                                                 $10
         16        DO_ICALL                                                 
   34    17      > RETURN                                                   1

Function unanswered:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 24
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 22
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 19
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 20
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TqN3Y
function name:  unanswered
number of ops:  26
compiled vars:  !0 = $array1, !1 = $array2, !2 = $unanswered_arrays, !3 = $b, !4 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        ISSET_ISEMPTY_CV                                 ~5      !1
          3        BOOL_NOT                                         ~6      ~5
          4      > JMPZ                                                     ~6, ->24
   19     5    >   ASSIGN                                                   !2, <array>
   20     6      > FE_RESET_R                                       $8      !0, ->22
          7    > > FE_FETCH_R                                               $8, !3, ->22
   21     8    > > FE_RESET_R                                       $9      !1, ->20
          9    > > FE_FETCH_R                                               $9, !4, ->20
   22    10    >   FETCH_OBJ_R                                      ~10     !3, 'id'
         11        FETCH_OBJ_R                                      ~11     !4, 'id_of'
         12        IS_NOT_EQUAL                                             ~10, ~11
         13      > JMPZ                                                     ~12, ->19
   23    14    >   INIT_FCALL                                               'array_push'
         15        SEND_REF                                                 !2
         16        CAST                                          8  ~13     !3
         17        SEND_VAL                                                 ~13
         18        DO_ICALL                                                 
   21    19    > > JMP                                                      ->9
         20    >   FE_FREE                                                  $9
   20    21      > JMP                                                      ->7
         22    >   FE_FREE                                                  $8
   27    23      > RETURN                                                   !2
   29    24    > > RETURN                                                   !0
   30    25*     > RETURN                                                   null

End of function unanswered

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.92 ms | 1019 KiB | 16 Q