How to work with PHP abstract?

Posted by YumYumYum on Stack Overflow See other posts from Stack Overflow or by YumYumYum
Published on 2011-08-30T12:31:51Z Indexed on 2012/09/16 21:38 UTC
Read the original article Hit count: 203

Filed under:
|
|

Why would you use such abstract? Does it speed up work or what exactly its for?

// file1.php
abstract class Search_Adapter_Abstract {
    private $ch = null;
    abstract private function __construct()
    {
    }       
    abstract public funciton __destruct() { 
      curl_close($this->ch);
    }
    abstract public function search($searchString,$offset,$count);
}

// file2.php
include("file1.php");
class abc extends Search_Adapter_Abstract
{
    // Will the curl_close now automatically be closed?

}

What is the reason of extending abstract here? Makes me confused. What can i get from it now?

© Stack Overflow or respective owner

Related posts about php

Related posts about oop