title: What does it mean to call a class inside a method as a parameter?
body: <p>I've sometimes seen developers put the name of a class as a parameter in a method of another class.<br> I would like to know what that means, is it something like inheritance? Does this make it possible for the method to make use of methods and fields of that class being passed as a parameter?</p>
  <pre><code>&lt;?php
  
  declare(strict_types = 1);
  
  class SimpleClass
  {
      public function sayHello(): void
      {
          echo(&quot;Hello!&quot;);
      }
  }
  
  class Main
  {
      public static function main(SimpleClass): void
      {
          //sayHello();
      }
  }
  </code></pre>
  <p>I tested the code above, but reported an error. However, I've seen some developers make this use, so I'd like to understand what it means.</p>