title: What is the difference between self::$bar and static::$bar in PHP?
body: <p>What is the difference between using <code>self</code> and <code>static</code> in the example below?</p>
  
  <pre><code>class Foo
  {
      protected static $bar = 1234;
  
      public static function instance()
      {
          echo self::$bar;
          echo "\n";
          echo static::$bar;
      }
  
  }
  
  Foo::instance();
  </code></pre>
  
  <h3>produces</h3>
  
  <pre><code>1234
  1234
  </code></pre>