title: PHP: Fatal error: Cannot instantiate abstract class
body: <p>I have an abstract database class named as:</p>
  
  <pre><code>abstract class database {
    protected $value;
  }
  </code></pre>
  
  <p>I created another abstract class </p>
  
  <pre><code>abstract class my_database extends database {
    public function set_value($value) {
      $this-&gt;value = $value;
    }
  }
  </code></pre>
  
  <p>When I try to use it:</p>
  
  <pre><code>$my_db = new my_database();
  </code></pre>
  
  <p>I get error:</p>
  
  <pre><code>Fatal error: Cannot instantiate abstract class my_database in ...
  </code></pre>
  
  <p><strong>What I try to do is: The abstract class database has a protected $value and I would like to create a wrapper class, to be able to change the protected value (temporarily).</strong></p>
  
  <p>How can I do that?</p>
  
  <p>EDIT1: unfortunately earlier, when I tried without abstract my_database, I got the errors:</p>
  
  <pre><code>- abstract methods and must therefore be declared abstract or implemented
  - Abstract function cannot contain body
  </code></pre>
  
  <p>EDIT2:
  After taking out the abstract word completely from my_database, I got the following error:</p>
  
  <blockquote>
    <p>Fatal error: Class my_database contains 32 abstract methods and must
    therefore be declared abstract or implement the remaining methods</p>
  </blockquote>
  
  <p>How can I fix this? </p>