3v4l.org

run code in 300+ PHP versions simultaneously
<?php function arrayReplace($a1, $a2) { foreach($a2 as $k=>$v) { $a1[$k]=$v; } return $a1; } function arrayDiffFull() { $numArrays=func_num_args(); $totalA=array(); $returnA=array(); $arg_list = func_get_args(); foreach($arg_list as $i=>$eachArray) { foreach($eachArray as $k=>$value) { $totalA[$k][$i]=strtolower($value); } } foreach($totalA as $k=>$eachKArray) { if ( count($eachKArray)!=$numArrays || count(array_unique($eachKArray))!=1 ) { $returnA[$k]=arrayReplace( array_fill(0,$numArrays,''), $eachKArray ); } } return $returnA; } $a1 = array(0 => 1, 1 => "b", 3 => "carrot"); $a2 = array(1 => "b", 2 => "d", 3 => "carrot"); print_r(arrayDiffFull($a1, $a2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kYUXp
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a1, !1 = $a2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   ASSIGN                                                   !0, <array>
   31     1        ASSIGN                                                   !1, <array>
   32     2        INIT_FCALL                                               'print_r'
          3        INIT_FCALL                                               'arraydifffull'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function arrayreplace:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/kYUXp
function name:  arrayReplace
number of ops:  11
compiled vars:  !0 = $a1, !1 = $a2, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2      > FE_RESET_R                                       $4      !1, ->8
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->8
          4    >   ASSIGN                                                   !3, ~5
    4     5        ASSIGN_DIM                                               !0, !3
          6        OP_DATA                                                  !2
    3     7      > JMP                                                      ->3
          8    >   FE_FREE                                                  $4
    6     9      > RETURN                                                   !0
    7    10*     > RETURN                                                   null

End of function arrayreplace

Function arraydifffull:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 21
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 19
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 47
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 47
Branch analysis from position: 24
2 jumps found. (Code = 47) Position 1 = 28, Position 2 = 34
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 46
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 46
Branch analysis from position: 34
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 21
filename:       /in/kYUXp
function name:  arrayDiffFull
number of ops:  50
compiled vars:  !0 = $numArrays, !1 = $totalA, !2 = $returnA, !3 = $arg_list, !4 = $eachArray, !5 = $i, !6 = $value, !7 = $k, !8 = $eachKArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FUNC_NUM_ARGS                                    ~9      
          1        ASSIGN                                                   !0, ~9
   11     2        ASSIGN                                                   !1, <array>
   12     3        ASSIGN                                                   !2, <array>
   14     4        FUNC_GET_ARGS                                    ~13     
          5        ASSIGN                                                   !3, ~13
   15     6      > FE_RESET_R                                       $15     !3, ->21
          7    > > FE_FETCH_R                                       ~16     $15, !4, ->21
          8    >   ASSIGN                                                   !5, ~16
   16     9      > FE_RESET_R                                       $18     !4, ->19
         10    > > FE_FETCH_R                                       ~19     $18, !6, ->19
         11    >   ASSIGN                                                   !7, ~19
   17    12        INIT_FCALL                                               'strtolower'
         13        SEND_VAR                                                 !6
         14        DO_ICALL                                         $23     
         15        FETCH_DIM_W                                      $21     !1, !7
         16        ASSIGN_DIM                                               $21, !5
         17        OP_DATA                                                  $23
   16    18      > JMP                                                      ->10
         19    >   FE_FREE                                                  $18
   15    20      > JMP                                                      ->7
         21    >   FE_FREE                                                  $15
   21    22      > FE_RESET_R                                       $24     !1, ->47
         23    > > FE_FETCH_R                                       ~25     $24, !8, ->47
         24    >   ASSIGN                                                   !7, ~25
   22    25        COUNT                                            ~27     !8
         26        IS_NOT_EQUAL                                     ~28     !0, ~27
         27      > JMPNZ_EX                                         ~28     ~28, ->34
         28    >   INIT_FCALL                                               'array_unique'
         29        SEND_VAR                                                 !8
         30        DO_ICALL                                         $29     
         31        COUNT                                            ~30     $29
         32        IS_NOT_EQUAL                                     ~31     ~30, 1
         33        BOOL                                             ~28     ~31
         34    > > JMPZ                                                     ~28, ->46
   23    35    >   INIT_FCALL                                               'arrayreplace'
         36        INIT_FCALL                                               'array_fill'
         37        SEND_VAL                                                 0
         38        SEND_VAR                                                 !0
         39        SEND_VAL                                                 ''
         40        DO_ICALL                                         $33     
         41        SEND_VAR                                                 $33
         42        SEND_VAR                                                 !8
         43        DO_FCALL                                      0  $34     
         44        ASSIGN_DIM                                               !2, !7
         45        OP_DATA                                                  $34
   21    46    > > JMP                                                      ->23
         47    >   FE_FREE                                                  $24
   27    48      > RETURN                                                   !2
   28    49*     > RETURN                                                   null

End of function arraydifffull

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.22 ms | 1407 KiB | 23 Q