Kurucu Yıkıcı Methodlar

public function __construct(){
        echo 'SINIF BAŞLADI';
    }
public function __destruct(){
    echo 'SINIF SONLANDI';
}

Bir sınıf başlatıldığında çalışacak ilk method __construct() son method __destruct() methodlarıdır. img_4.png


__construct()'a parametre gönderilebilir. Gönderilen parametreleri __construct' sınıfı başlatırken iletebiliriz.

img_5.png

Lesson discussion

Swap insights and ask questions about PHP Temel

Be the first to start the discussion

Ask a question or share your thoughts about this lesson.