Exemplo n.º 1
0
        if (in_array($b, $boi)) {
            $this->boja = $b;
        } else {
            $this->boja = 'crna';
        }
    }
    public function __destruct()
    {
        echo "DESTRUCTORRRR!";
    }
}
$m1 = new Marker('siva');
// po avtomatizam go povikuva konstruktorot
// $m1->setBoja('zelena');
// echo $m1->getBoja();
$m1->crtaj();
unset($m1);
// po avtomatizam go povikuva desctruktorot
echo "\n\n\n\nEND!\n";
class File
{
    private $fh;
    // file handle
    private $filename;
    public function __construct($filename)
    {
        $this->fh = fopen($filename, 'a+');
        $this->filename = $filename;
    }
    public function write($text)
    {