3v4l.org

run code in 300+ PHP versions simultaneously
<?php function noSort($a, $b) { $result = []; foreach ($a as $v) { $index = array_search($v, $b); if ($index !== false) { $result[] = $v; unset($b[$index]); } } return $result; } function intersectSimpler(...$twoArrays) { $result = []; sort($twoArrays); foreach ($twoArrays[0] as $v) { $index = array_search($v, $twoArrays[1]); if ($index !== false) { $result[] = $v; unset($twoArrays[1][$index]); } } return $result; } function intersectSimplest($a, $b): array { $result = []; if (count($a) < count($b)) { $short = $a; $long = $b; } else { $short = $b; $long = $a; } foreach ($short as $v) { $index = array_search($v, $long); if ($index !== false) { $result[] = $v; unset($long[$index]); } } return $result; } function intersectSimplish($a, $b): array { $result = []; if (count($a) < count($b)) { $short = $a; $long = $b; } else { $short = $b; $long = $a; } foreach ($short as $v) { if (in_array($v, $long)) { $result[] = $v; unset($long[array_search($v, $long)]); } } return $result; } function intersectSimple($a, $b) { $result = array(); $short = count($a) < count($b) ? $a : $b; $long = count($a) < count($b) ? $b : $a; foreach ($short as $v) { if (in_array($v, $long)) { //if found add to results and remove from b $result[] = $v; unset($long[array_search($v, $long)]); } } return $result; } function intersectAderrahim($a, $b) { $a_values_count = array_count_values($a); $b_values_count = array_count_values($b); $res = array_values(array_intersect($a, $b)); $res_values_count = array_count_values($res); foreach ($res as $key => $val) { if ($res_values_count[$val] > $a_values_count[$val] || $res_values_count[$val] > $b_values_count[$val]) { unset($res[$key]); $res_values_count[$val]--; } } return array_values($res); } //Start timer $start = microtime(true); echo "Start Test\n"; //Run code 100000 times for ($i = 0; $i < 100000; $i++) { $a = [1, 1, 1, 1, 2, 3, 4, 4, 5, 6, 8, 8, 8]; $b = [1, 1, 3, 3, 5, 5, 5, 6, 7, 9, 9]; $result = intersectAderrahim($a, $b); } //Stop timer $end = microtime(true); $time = $end - $start; //Print performance in microseconds echo "Performance Aderrahim: $time\n"; //Start timer $start = microtime(true); echo "Start Test\n"; //Run code 100000 times for ($i = 0; $i < 100000; $i++) { $a = [1, 1, 1, 1, 2, 3, 4, 4, 5, 6, 8, 8, 8]; $b = [1, 1, 3, 3, 5, 5, 5, 6, 7, 9, 9]; $result = noSort($a, $b); } //Stop timer $end = microtime(true); $time = $end - $start; //Print performance in microseconds echo "Performance NoSort: $time\n"; //Start timer $start = microtime(true); echo "Start Test\n"; //Run code 100000 times for ($i = 0; $i < 100000; $i++) { $a = [1, 1, 1, 1, 2, 3, 4, 4, 5, 6, 8, 8, 8]; $b = [1, 1, 3, 3, 5, 5, 5, 6, 7, 9, 9]; $result = intersectSimpler($a, $b); } //Stop timer $end = microtime(true); $time = $end - $start; //Print performance in microseconds echo "Performance Simpler: $time\n"; //Start timer $start = microtime(true); echo "Start Test\n"; //Run code 100000 times for ($i = 0; $i < 100000; $i++) { $a = [1, 1, 1, 1, 2, 3, 4, 4, 5, 6, 8, 8, 8]; $b = [1, 1, 3, 3, 5, 5, 5, 6, 7, 9, 9]; $result = intersectSimplish($a, $b); } //Stop timer $end = microtime(true); $time = $end - $start; //Print performance in microseconds echo "Performance Simplish: $time\n"; //Start timer $start = microtime(true); echo "Start Test\n"; //Run code 100000 times for ($i = 0; $i < 100000; $i++) { $a = [1, 1, 1, 1, 2, 3, 4, 4, 5, 6, 8, 8, 8]; $b = [1, 1, 3, 3, 5, 5, 5, 6, 7, 9, 9]; $result = intersectSimplest($a, $b); } //Stop timer $end = microtime(true); $time = $end - $start; //Print performance in microseconds echo "Performance Simplest: $time\n"; //Start timer $start = microtime(true); echo "Start Test\n"; //Run code 100000 times for ($i = 0; $i < 100000; $i++) { $a = [1, 1, 1, 1, 2, 3, 4, 4, 5, 6, 8, 8, 8]; $b = [1, 1, 3, 3, 5, 5, 5, 6, 7, 9, 9]; $result = intersectSimple($a, $b); } //Stop timer $end = microtime(true); $time = $end - $start; //Print performance in microseconds echo "Performance Simple: $time\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 34
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
2 jumps found. (Code = 44) Position 1 = 71, Position 2 = 61
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
2 jumps found. (Code = 44) Position 1 = 98, Position 2 = 88
Branch analysis from position: 98
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
2 jumps found. (Code = 44) Position 1 = 125, Position 2 = 115
Branch analysis from position: 125
1 jumps found. (Code = 42) Position 1 = 150
Branch analysis from position: 150
2 jumps found. (Code = 44) Position 1 = 152, Position 2 = 142
Branch analysis from position: 152
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 142
2 jumps found. (Code = 44) Position 1 = 152, Position 2 = 142
Branch analysis from position: 152
Branch analysis from position: 142
Branch analysis from position: 115
2 jumps found. (Code = 44) Position 1 = 125, Position 2 = 115
Branch analysis from position: 125
Branch analysis from position: 115
Branch analysis from position: 88
2 jumps found. (Code = 44) Position 1 = 98, Position 2 = 88
Branch analysis from position: 98
Branch analysis from position: 88
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 71, Position 2 = 61
Branch analysis from position: 71
Branch analysis from position: 61
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 34
Branch analysis from position: 44
Branch analysis from position: 34
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
filename:       /in/ONfnr
function name:  (null)
number of ops:  163
compiled vars:  !0 = $start, !1 = $i, !2 = $a, !3 = $b, !4 = $result, !5 = $end, !6 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  105     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $7      
          3        ASSIGN                                                   !0, $7
  107     4        ECHO                                                     'Start+Test%0A'
  109     5        ASSIGN                                                   !1, 0
          6      > JMP                                                      ->15
  111     7    >   ASSIGN                                                   !2, <array>
  112     8        ASSIGN                                                   !3, <array>
  113     9        INIT_FCALL                                               'intersectaderrahim'
         10        SEND_VAR                                                 !2
         11        SEND_VAR                                                 !3
         12        DO_FCALL                                      0  $12     
         13        ASSIGN                                                   !4, $12
  109    14        PRE_INC                                                  !1
         15    >   IS_SMALLER                                               !1, 100000
         16      > JMPNZ                                                    ~15, ->7
  116    17    >   INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $16     
         20        ASSIGN                                                   !5, $16
  117    21        SUB                                              ~18     !5, !0
         22        ASSIGN                                                   !6, ~18
  119    23        ROPE_INIT                                     3  ~21     'Performance+Aderrahim%3A+'
         24        ROPE_ADD                                      1  ~21     ~21, !6
         25        ROPE_END                                      2  ~20     ~21, '%0A'
         26        ECHO                                                     ~20
  122    27        INIT_FCALL                                               'microtime'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $23     
         30        ASSIGN                                                   !0, $23
  124    31        ECHO                                                     'Start+Test%0A'
  126    32        ASSIGN                                                   !1, 0
         33      > JMP                                                      ->42
  128    34    >   ASSIGN                                                   !2, <array>
  129    35        ASSIGN                                                   !3, <array>
  130    36        INIT_FCALL                                               'nosort'
         37        SEND_VAR                                                 !2
         38        SEND_VAR                                                 !3
         39        DO_FCALL                                      0  $28     
         40        ASSIGN                                                   !4, $28
  126    41        PRE_INC                                                  !1
         42    >   IS_SMALLER                                               !1, 100000
         43      > JMPNZ                                                    ~31, ->34
  133    44    >   INIT_FCALL                                               'microtime'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $32     
         47        ASSIGN                                                   !5, $32
  134    48        SUB                                              ~34     !5, !0
         49        ASSIGN                                                   !6, ~34
  136    50        ROPE_INIT                                     3  ~37     'Performance+NoSort%3A+'
         51        ROPE_ADD                                      1  ~37     ~37, !6
         52        ROPE_END                                      2  ~36     ~37, '%0A'
         53        ECHO                                                     ~36
  139    54        INIT_FCALL                                               'microtime'
         55        SEND_VAL                                                 <true>
         56        DO_ICALL                                         $39     
         57        ASSIGN                                                   !0, $39
  141    58        ECHO                                                     'Start+Test%0A'
  143    59        ASSIGN                                                   !1, 0
         60      > JMP                                                      ->69
  145    61    >   ASSIGN                                                   !2, <array>
  146    62        ASSIGN                                                   !3, <array>
  147    63        INIT_FCALL                                               'intersectsimpler'
         64        SEND_VAR                                                 !2
         65        SEND_VAR                                                 !3
         66        DO_FCALL                                      0  $44     
         67        ASSIGN                                                   !4, $44
  143    68        PRE_INC                                                  !1
         69    >   IS_SMALLER                                               !1, 100000
         70      > JMPNZ                                                    ~47, ->61
  150    71    >   INIT_FCALL                                               'microtime'
         72        SEND_VAL                                                 <true>
         73        DO_ICALL                                         $48     
         74        ASSIGN                                                   !5, $48
  151    75        SUB                                              ~50     !5, !0
         76        ASSIGN                                                   !6, ~50
  153    77        ROPE_INIT                                     3  ~53     'Performance+Simpler%3A+'
         78        ROPE_ADD                                      1  ~53     ~53, !6
         79        ROPE_END                                      2  ~52     ~53, '%0A'
         80        ECHO                                                     ~52
  156    81        INIT_FCALL                                               'microtime'
         82        SEND_VAL                                                 <true>
         83        DO_ICALL                                         $55     
         84        ASSIGN                                                   !0, $55
  158    85        ECHO                                                     'Start+Test%0A'
  160    86        ASSIGN                                                   !1, 0
         87      > JMP                                                      ->96
  162    88    >   ASSIGN                                                   !2, <array>
  163    89        ASSIGN                                                   !3, <array>
  164    90        INIT_FCALL                                               'intersectsimplish'
         91        SEND_VAR                                                 !2
         92        SEND_VAR                                                 !3
         93        DO_FCALL                                      0  $60     
         94        ASSIGN                                                   !4, $60
  160    95        PRE_INC                                                  !1
         96    >   IS_SMALLER                                               !1, 100000
         97      > JMPNZ                                                    ~63, ->88
  167    98    >   INIT_FCALL                                               'microtime'
         99        SEND_VAL                                                 <true>
        100        DO_ICALL                                         $64     
        101        ASSIGN                                                   !5, $64
  168   102        SUB                                              ~66     !5, !0
        103        ASSIGN                                                   !6, ~66
  170   104        ROPE_INIT                                     3  ~69     'Performance+Simplish%3A+'
        105        ROPE_ADD                                      1  ~69     ~69, !6
        106        ROPE_END                                      2  ~68     ~69, '%0A'
        107        ECHO                                                     ~68
  173   108        INIT_FCALL                                               'microtime'
        109        SEND_VAL                                                 <true>
        110        DO_ICALL                                         $71     
        111        ASSIGN                                                   !0, $71
  175   112        ECHO                                                     'Start+Test%0A'
  177   113        ASSIGN                                                   !1, 0
        114      > JMP                                                      ->123
  179   115    >   ASSIGN                                                   !2, <array>
  180   116        ASSIGN                                                   !3, <array>
  181   117        INIT_FCALL                                               'intersectsimplest'
        118        SEND_VAR                                                 !2
        119        SEND_VAR                                                 !3
        120        DO_FCALL                                      0  $76     
        121        ASSIGN                                                   !4, $76
  177   122        PRE_INC                                                  !1
        123    >   IS_SMALLER                                               !1, 100000
        124      > JMPNZ                                                    ~79, ->115
  184   125    >   INIT_FCALL                                               'microtime'
        126        SEND_VAL                                                 <true>
        127        DO_ICALL                                         $80     
        128        ASSIGN                                                   !5, $80
  185   129        SUB                                              ~82     !5, !0
        130        ASSIGN                                                   !6, ~82
  187   131        ROPE_INIT                                     3  ~85     'Performance+Simplest%3A+'
        132        ROPE_ADD                                      1  ~85     ~85, !6
        133        ROPE_END                                      2  ~84     ~85, '%0A'
        134        ECHO                                                     ~84
  190   135        INIT_FCALL                                               'microtime'
        136        SEND_VAL                                                 <true>
        137        DO_ICALL                                         $87     
        138        ASSIGN                                                   !0, $87
  192   139        ECHO                                                     'Start+Test%0A'
  194   140        ASSIGN                                                   !1, 0
        141      > JMP                                                      ->150
  196   142    >   ASSIGN                                                   !2, <array>
  197   143        ASSIGN                                                   !3, <array>
  198   144        INIT_FCALL                                               'intersectsimple'
        145        SEND_VAR                                                 !2
        146        SEND_VAR                                                 !3
        147        DO_FCALL                                      0  $92     
        148        ASSIGN                                                   !4, $92
  194   149        PRE_INC                                                  !1
        150    >   IS_SMALLER                                               !1, 100000
        151      > JMPNZ                                                    ~95, ->142
  202   152    >   INIT_FCALL                                               'microtime'
        153        SEND_VAL                                                 <true>
        154        DO_ICALL                                         $96     
        155        ASSIGN                                                   !5, $96
  203   156        SUB                                              ~98     !5, !0
        157        ASSIGN                                                   !6, ~98
  205   158        ROPE_INIT                                     3  ~101    'Performance+Simple%3A+'
        159        ROPE_ADD                                      1  ~101    ~101, !6
        160        ROPE_END                                      2  ~100    ~101, '%0A'
        161        ECHO                                                     ~100
        162      > RETURN                                                   1

Function nosort:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/ONfnr
function name:  noSort
number of ops:  19
compiled vars:  !0 = $a, !1 = $b, !2 = $result, !3 = $v, !4 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ASSIGN                                                   !2, <array>
    6     3      > FE_RESET_R                                       $6      !0, ->16
          4    > > FE_FETCH_R                                               $6, !3, ->16
    7     5    >   INIT_FCALL                                               'array_search'
          6        SEND_VAR                                                 !3
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !4, $7
    8    10        TYPE_CHECK                                  1018          !4
         11      > JMPZ                                                     ~9, ->15
    9    12    >   ASSIGN_DIM                                               !2
         13        OP_DATA                                                  !3
   10    14        UNSET_DIM                                                !1, !4
    6    15    > > JMP                                                      ->4
         16    >   FE_FREE                                                  $6
   13    17      > RETURN                                                   !2
   14    18*     > RETURN                                                   null

End of function nosort

Function intersectsimpler:
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 = 43) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 20
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/ONfnr
function name:  intersectSimpler
number of ops:  24
compiled vars:  !0 = $twoArrays, !1 = $result, !2 = $v, !3 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV_VARIADIC                                    !0      
   18     1        ASSIGN                                                   !1, <array>
   19     2        INIT_FCALL                                               'sort'
          3        SEND_REF                                                 !0
          4        DO_ICALL                                                 
   20     5        FETCH_DIM_R                                      ~6      !0, 0
          6      > FE_RESET_R                                       $7      ~6, ->21
          7    > > FE_FETCH_R                                               $7, !2, ->21
   21     8    >   INIT_FCALL                                               'array_search'
          9        SEND_VAR                                                 !2
         10        FETCH_DIM_R                                      ~8      !0, 1
         11        SEND_VAL                                                 ~8
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !3, $9
   22    14        TYPE_CHECK                                  1018          !3
         15      > JMPZ                                                     ~11, ->20
   23    16    >   ASSIGN_DIM                                               !1
         17        OP_DATA                                                  !2
   24    18        FETCH_DIM_UNSET                                  $13     !0, 1
         19        UNSET_DIM                                                $13, !3
   20    20    > > JMP                                                      ->7
         21    >   FE_FREE                                                  $7
   27    22      > RETURN                                                   !1
   28    23*     > RETURN                                                   null

End of function intersectsimpler

Function intersectsimplest:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 25
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 24
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
Branch analysis from position: 25
filename:       /in/ONfnr
function name:  intersectSimplest
number of ops:  30
compiled vars:  !0 = $a, !1 = $b, !2 = $result, !3 = $short, !4 = $long, !5 = $v, !6 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   32     2        ASSIGN                                                   !2, <array>
   33     3        COUNT                                            ~8      !0
          4        COUNT                                            ~9      !1
          5        IS_SMALLER                                               ~8, ~9
          6      > JMPZ                                                     ~10, ->10
   34     7    >   ASSIGN                                                   !3, !0
   35     8        ASSIGN                                                   !4, !1
   33     9      > JMP                                                      ->12
   37    10    >   ASSIGN                                                   !3, !1
   38    11        ASSIGN                                                   !4, !0
   40    12    > > FE_RESET_R                                       $15     !3, ->25
         13    > > FE_FETCH_R                                               $15, !5, ->25
   41    14    >   INIT_FCALL                                               'array_search'
         15        SEND_VAR                                                 !5
         16        SEND_VAR                                                 !4
         17        DO_ICALL                                         $16     
         18        ASSIGN                                                   !6, $16
   42    19        TYPE_CHECK                                  1018          !6
         20      > JMPZ                                                     ~18, ->24
   43    21    >   ASSIGN_DIM                                               !2
         22        OP_DATA                                                  !5
   44    23        UNSET_DIM                                                !4, !6
   40    24    > > JMP                                                      ->13
         25    >   FE_FREE                                                  $15
   47    26        VERIFY_RETURN_TYPE                                       !2
         27      > RETURN                                                   !2
   48    28*       VERIFY_RETURN_TYPE                                       
         29*     > RETURN                                                   null

End of function intersectsimplest

Function intersectsimplish:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 27
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 27
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 26
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 26
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 27
Branch analysis from position: 13
Branch analysis from position: 27
filename:       /in/ONfnr
function name:  intersectSimplish
number of ops:  32
compiled vars:  !0 = $a, !1 = $b, !2 = $result, !3 = $short, !4 = $long, !5 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   52     2        ASSIGN                                                   !2, <array>
   53     3        COUNT                                            ~7      !0
          4        COUNT                                            ~8      !1
          5        IS_SMALLER                                               ~7, ~8
          6      > JMPZ                                                     ~9, ->10
   54     7    >   ASSIGN                                                   !3, !0
   55     8        ASSIGN                                                   !4, !1
   53     9      > JMP                                                      ->12
   57    10    >   ASSIGN                                                   !3, !1
   58    11        ASSIGN                                                   !4, !0
   60    12    > > FE_RESET_R                                       $14     !3, ->27
         13    > > FE_FETCH_R                                               $14, !5, ->27
   61    14    >   INIT_FCALL                                               'in_array'
         15        SEND_VAR                                                 !5
         16        SEND_VAR                                                 !4
         17        DO_ICALL                                         $15     
         18      > JMPZ                                                     $15, ->26
   62    19    >   ASSIGN_DIM                                               !2
         20        OP_DATA                                                  !5
   63    21        INIT_FCALL                                               'array_search'
         22        SEND_VAR                                                 !5
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                         $17     
         25        UNSET_DIM                                                !4, $17
   60    26    > > JMP                                                      ->13
         27    >   FE_FREE                                                  $14
   66    28        VERIFY_RETURN_TYPE                                       !2
         29      > RETURN                                                   !2
   67    30*       VERIFY_RETURN_TYPE                                       
         31*     > RETURN                                                   null

End of function intersectsimplish

Function intersectsimple:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 34
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 34
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 33
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 33
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 34
Branch analysis from position: 20
Branch analysis from position: 34
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
Branch analysis from position: 17
filename:       /in/ONfnr
function name:  intersectSimple
number of ops:  37
compiled vars:  !0 = $a, !1 = $b, !2 = $result, !3 = $short, !4 = $long, !5 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   69     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   71     2        ASSIGN                                                   !2, <array>
   72     3        COUNT                                            ~7      !0
          4        COUNT                                            ~8      !1
          5        IS_SMALLER                                               ~7, ~8
          6      > JMPZ                                                     ~9, ->9
          7    >   QM_ASSIGN                                        ~10     !0
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~10     !1
         10    >   ASSIGN                                                   !3, ~10
   73    11        COUNT                                            ~12     !0
         12        COUNT                                            ~13     !1
         13        IS_SMALLER                                               ~12, ~13
         14      > JMPZ                                                     ~14, ->17
         15    >   QM_ASSIGN                                        ~15     !1
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~15     !0
         18    >   ASSIGN                                                   !4, ~15
   74    19      > FE_RESET_R                                       $17     !3, ->34
         20    > > FE_FETCH_R                                               $17, !5, ->34
   75    21    >   INIT_FCALL                                               'in_array'
         22        SEND_VAR                                                 !5
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                    

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
260.3 ms | 1049 KiB | 24 Q