title: var_dump() returns NULL somehow
body: <p>I made a function to validate the e-mail address to vaidate and check if they are matched or not. </p>
  
  <p>But it doesn't seem to work because when I <code>var_dump()</code>. </p>
  
  <p>I got the <code>null</code> value such as: <code>NULL string(13) 123@gmail.com</code>. Could you give me some advice to fix this? I'm completely stuck.</p>
  
  <pre><code>function email_validate_n_match($value)
  {
  
      if( $value == '') return;
      if( preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $value) ) {
  
          static $count = 0;
  
          if($count == 0) {
              $value1 = $value;
          } else if($count == 1) {
              $value2 = $value;
          }
  
          var_dump($value2);
  
          // if ($value1 == $value2) {
              //  return;
          // }else{
              //  $this-&gt;clear = false;
              //  return $this-&gt;tag_st . 'Doesn't match.' . $this-&gt;tag_ed;
          // }
  
          $count++;
  
          return;
  
      } else {
  
          $this-&gt;clear = false;
  
          return $this-&gt;tag_st . 'Put the correct email address.' . $this-&gt;tag_ed;
      }
  }
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Thanks for the answers.</p>
  
  <p>When I put this</p>
  
  <pre><code>static $count = 0;
  
  if($count == 0) {
      $value1 = $value;
      echo '0';
  } else if($count == 1) {
      $value2 = $value;
      echo '1';
  }
  </code></pre>
  
  <p>it outputs <code>01</code>. On the other hand,</p>
  
  <p>If I remove static, I get <code>00</code>.</p>
  
  <p>so I think this <code>$count</code> is working, but I'm still confused why I got <code>NULL</code> result above.</p>