title: Nested or Inner Class in PHP
body: <p>I'm building a <strong>User Class</strong> for my new website, however this time I was thinking to build it little bit differently...</p>
  
  <p><strong>C++</strong>, <strong>Java</strong> and even <strong>Ruby</strong> (and probably other programming languages) are allowing the use of nested/inner classes inside the main class, which allows us to make the code more object-oriented and organized.</p>
  
  <p>In PHP, I would like to do something like so:</p>
  
  <pre><code>&lt;?php
    public class User {
      public $userid;
      public $username;
      private $password;
  
      public class UserProfile {
        // some code here
      }
  
      private class UserHistory {
        // some code here
      }
    }
  ?&gt;
  </code></pre>
  
  <p>Is that possible in PHP? How can I achieve it?</p>
  
  <hr>
  
  <p><strong>UPDATE</strong></p>
  
  <p>If it's impossible, will future PHP versions might support nested classes?</p>