title: Efficient PHP algorithm to multiply two 3-digit numbers in all configurations
body: <p>I'm trying to get the results of multiplication of all combinations of two 
  3-digit numbers.</p>
  
  <p>I realized that each time I execute a script that does a lot fewer operations than the number of operations in above task, the execution time always exceeds 30 second, and the script halts:</p>
  
  <pre><code>    $x = 100;
      $y = 100;
      $z = $x * $y;
      while($this-&gt;isMagicNumber($z) == false) {
          if ($x + 1 &lt; 1000) {
              $x++;
          } elseif ($x = 999) {
              if($y + 1 &lt; 1000) {
                  $y++;
              }
          }
          $z = $x * $y;
      }
  </code></pre>
  
  <p>This algorithm is by no means efficient, and it does not check all multiplication combinations, and it already takes too long to execute.</p>
  
  <p>What would be the way to find the results of all possible multiplications of two 3-digit numbers?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>The <code>isMagicNumber()</code> method might, in fact, be the case why the script takes so long to execute, but, on the other hand, it doesn't seem excessively complicated:</p>
  
  <pre><code>private function isMagicNumber($number)
  {
  
      if ($number === strrev($number)) {
          echo $number . ' is a Palindrome';
          return true;
      }
  
      return false;
  }
  </code></pre>
  
  <p><strong>Edit 2</strong>
  Just a reminder:</p>
  
  <blockquote>
    <p>Down-voting should be reserved for extreme cases. It's not meant as a
    substitute for communication and editing.</p>
  </blockquote>