title: How to access variable value out of an abstract call in PHP
body: <p>I'm trying to access outside variable values in Abstract class.
  I don't know if I'm doing something wrong. The following code shows what I tried to do so far.</p>
  
  <pre><code>  &lt;?php
      require_once 'config.php';
  
      abstract class connect {
          protected $link;
          public function __construct($dbhost,$dbuser,$dbpass,$dbname2) {
  
              $host = $dbhost;
              $user = $dbuser;
              $password = $dbpass;
              $database = $dbname2;
              // $host = 'localhost';
              // $user = 'student';
              // $password = 'c@18504';
              // $database = 'practice';
              $this-&gt;link = @mysqli_connect($host, $user, $password, $database);
              if(!mysqli_connect_errno()) {
  
              } else {
                  die("connection error: ".  mysqli_connect_error());
  
              }
          }
      }
  ?&gt;
  </code></pre>