title: Catchable fatal error: Argument 1 passed to getPrice() must be an instance of Rectangle, none given
body: <p>I am just trying to calculate the price of the area of a rectangl outside the rectangle class which returns it's area. Just trying an example of polymorphism. Am I doing something wrong? 
  I am new to OOP aproach. Here's my code:</p>
  
  <pre><code>// getting the area
  class Rectangle{
  
      public $height;
      public $width;
  
      public function __construct($height, $width){
  
          $this-&gt;height = $height;
          $this-&gt;width = $width;
      }
  
      public function getArea(){
  
          return $this-&gt;height * $this-&gt;width. "&lt;br /&gt;";
      }
  
  }
  </code></pre>
  
  <p>Outside the class I created the function `getPrice()</p>
  
  <pre><code>`function getPrice(Rectangle $rectangle){
  
      return $rectangle-&gt;getArea() * 0.25;
  
  }
  </code></pre>
  
  <p>Creating the instance and printing out.</p>
  
  <pre><code>$rectangle = new Rectangle(12, 15);
  echo getPrice();
  </code></pre>
  
  <p>The error showing is :</p>
  
  <p>Catchable fatal error: Argument 1 passed to getPrice() must be an instance of Rectangle, none given, called in /var/www/html/crashcourse/oop_php/phpacademy/polymorphism.php on line 41 and defined in /var/www/html/crashcourse/oop_php/phpacademy/polymorphism.php on line 31</p>