İnternet Programlama Dersi – 1 (Güz-2017) Hafta – 10

<?php
/**
 * Created by PhpStorm.
 * User: caglar
 * Date: 30.11.2017
 * Time: 19:47
 */

include "urun.php";

$u = new urun();
$u->calistir();
<?php
/**
 * Created by PhpStorm.
 * User: caglar
 * Date: 30.11.2017
 * Time: 19:55
 */

class ortak
{
    public $ortak;
    public function calistir()
    {
        echo "calistir<br>";
    }

    public function ortak()
    {
        echo "ortak yapilandirici1";
    }

    public function __construct()
    {
        echo "ortak yapilandirici2";
    }

}
<?php
/**
 * Created by PhpStorm.
 * User: caglar
 * Date: 30.11.2017
 * Time: 19:45
 */

include "ortak.php";

class urun extends ortak
{
    public $adi,$fiyat,$stok;
    private $x;
    public function urun()
    {
        echo "urun yapilandirici1<br>";
    }

    public function __construct()
    {
        echo "urun yapilandirici2<br>";
        $this->x=10;
    }




}

 

Share