title: Why does PHP allow calling non-static methods statically but does not allow calling non-static properties statically?
body: <p>Why does PHP allow calling non-static method statically using Class Names and by the various keywords such as self, static &amp; parent which are placeholders for Class Names?</p>
  
  <hr>
  
  <blockquote>
    <p>But on the other hand it does not allow calling non-static properties
    statically?</p>
  </blockquote>
  
  <hr>
  
  <p>Here is the sample code -</p>
  
  <pre><code>&lt;?php
  
   # PHP Version 7.1.7
   error_reporting(E_ALL);
   ini_set('display_errors', 1);
  
   class Fruit {
       public $name = 'Fruit';
       public function x() {
           echo "Fruit_x" . "&lt;br&gt;";
       }
   }
  
   class Orange extends Fruit {
  
       public $name = 'Orange';
       public function x() {
           echo "Orange_x" . "&lt;br&gt;";
           parent::x();
           self::y();
           static::z();
  
           // Code Below will throu Uncaught Error: Access to undeclared static property
           // echo parent::$name . "&lt;br&gt;";
           // echo self::$name . "&lt;br&gt;";
  
       }
  
       public function y(){
           echo "Y" . "&lt;br&gt;";
       }
  
       public function z(){
           echo "Z" . "&lt;br&gt;";
       }
  
   }
  
  
   (new Orange)-&gt;x(); // No Warnings
  
   Orange::x();  // However calling like this shows warning as of PHP 5 &amp; 7
   // Docs - http://php.net/manual/en/language.oop5.static.php
  
  ?&gt;
  </code></pre>
  
  <p><a href="https://www.tehplayground.com/pyvLkZTZOxvlAe9s" rel="nofollow noreferrer">You can Run Code in the Browser to see the following Result</a></p>
  
  <p><a href="https://i.stack.imgur.com/RgIDa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RgIDa.png" alt="Expected Result"></a></p>
  
  <p><a href="http://php.net/manual/en/language.oop5.static.php" rel="nofollow noreferrer">PHP Static Keyword Docs</a></p>