<?php
  class A
  {
    public $wartosc_1 = 10;
    protected $wartosc_2 = 20;
    private $wartosc_3 = 30;
    public function wyswietl()
    {
      echo "wartosc_1 = ", $this->wartosc_1, "\n";
      echo "wartosc_2 = ", $this->wartosc_2, "\n";
      echo "wartosc_3 = ", $this->wartosc_3, "\n";
    }
  }

  class B extends A
  {
    public function wyswietl()
    {
      echo "wartosc_1 = ", $this->wartosc_1, "\n";
      echo "wartosc_2 = ", $this->wartosc_2, "\n";
      //echo "wartosc_3 = ", $this->wartosc_3, "\n";
    }
  }

  $objA = new A();
  $objB = new B();

  echo "Zawartość obiektu \$objA:\n";
  echo $objA->wartosc_1, "\n";
  //echo $objA->wartosc_2, "\n";
  //echo $objA->wartosc_3, "\n";

  $objA->wyswietl();

  echo "\nZawartość obiektu \$objB:\n";
  $objB->wyswietl();
?>
