title: Find match of an array in another array recursively not working
body: <p>I'm trying to find match of an array against another array recursively but the code fails and throws an error if the match doesn't find. Here's my complete code which only works when a match is found otherwise recursive function doesn't work for finding some another match.</p>
  
  <pre><code>&lt;?php
  $products = array(
                  191 =&gt; array(2),
                  192 =&gt; array(2,1),
                  237 =&gt; array(2,3),
                  238 =&gt; array(2,3,1),
                  239 =&gt; array(1,2),
                  266 =&gt; array()
              );
  
  
  $options = array(1,2,3);
  sort($options);
  
  echo find_product($options, $products);
  
  function find_product($options, $products)
  {
      foreach($products as $key =&gt; $value)
      {
          sort($value);
          if($value == $options)
          {
              $product_id = $key;
              break;
          }
      }
      if(!isset($product_id))
      {
          array_pop($options);
          echo "&lt;pre&gt;";
          print_r($options);
          //print_r($products);
          echo "&lt;/pre&gt;";
          find_product($options, $products);
      }
      return $product_id;
  }
  ?&gt;
  </code></pre>
  
  <p>output is 238, but when I commented the array element</p>
  
  <pre><code>//238 =&gt; array(2,3,1),
  </code></pre>
  
  <p>I'm getting following error</p>
  
  <pre><code> Notice: Undefined variable: product_id in C:\wamp\www\test.php on line 37
  </code></pre>
  
  <p>Expected output should be</p>
  
  <p>239</p>
  
  <p>How I can fix it to work with recursive function to find some other match?</p>