title: PHP5 - OOP - Polymorphism - Help me to rewrite this simple switch
body: <p>Assuming i have this classic <strong>switch</strong>, i know that when we are  building classes is not a good practice use the switch method, so, how i can rebuild this into a class without using <strong>switch</strong> but <strong>Polymorphism</strong> and i would like to understand the approach.</p>
  
  <pre><code>/**
   * globals below are holding unique id 
   * $Franklin['Franklin_id'] , 
   * $Granny_Smith['Granny_Smith_id'] , 
   * etc etc...
   */
  
  global $Fuji, $Gala, $Franklin, $Granny_Smith;
  
  switch($Apple) {
    case 'Fuji':
      $Color = 'Yellowish green';
      $Size = 'medium';
      $Origin = 'Japan';
      $Season = 'October - January';
      $AppleId = $Fuji['Fuji_id']; 
    break;
    case 'Gala':
      $Color = 'yellow';
      $Size = 'medium';
      $Origin = 'New Zealand';
      $Season = 'October - January';
      $AppleId = $Gala['Gala_id'];
    break;
    case 'Franklin':
      $Color = 'Well-colored';
      $Size = 'medium';
      $Origin = 'Ohio';
      $Season = 'October';
      $AppleId = $Franklin['Franklin_id'];
    break;
    case 'Granny_Smith':
      $Color = 'Green';
      $Size = 'medium';
      $Origin = 'Australia';
      $Season = 'October - December';
      $AppleId = $Granny_Smith['Granny_Smith_id'];
    break;
  }
  </code></pre>
  
  <p>then i would like to be able to use it something like this</p>
  
  <pre><code>$AppleProps = new getApple('Granny_Smith'); // $AppleProps-&gt;Color, etc etc
  </code></pre>
  
  <p>Thank you in advance and hope this can help someone else.</p>
  
  <p>Kind Regards</p>
  
  <p>Luca</p>
  
  <blockquote>
    <ul>
    <li>thank's to <a href="http://www.allaboutapples.com/" rel="nofollow">http://www.allaboutapples.com/</a> for Apples Informations ;)</li>
    </ul>
  </blockquote>