<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=PHP%2FClass%2FClass_Inheritance</id>
		<title>PHP/Class/Class Inheritance - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=PHP%2FClass%2FClass_Inheritance"/>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=PHP/Class/Class_Inheritance&amp;action=history"/>
		<updated>2026-04-04T18:46:17Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wbex.ru/index.php?title=PHP/Class/Class_Inheritance&amp;diff=26&amp;oldid=prev</id>
		<title> в 10:37, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=PHP/Class/Class_Inheritance&amp;diff=26&amp;oldid=prev"/>
				<updated>2010-05-26T10:37:27Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 10:37, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://wbex.ru/index.php?title=PHP/Class/Class_Inheritance&amp;diff=27&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=PHP/Class/Class_Inheritance&amp;diff=27&amp;oldid=prev"/>
				<updated>2010-05-26T07:00:43Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Class inheritance in action==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
class AbstractClass {&lt;br /&gt;
    function abstractFunction() {&lt;br /&gt;
        die( &amp;quot;AbstractClass::abstractFunction() is abstract\n&amp;quot; );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
class ConcreteClass extends AbstractClass {}&lt;br /&gt;
$test = new ConcreteClass();&lt;br /&gt;
$test-&amp;gt;abstractFunction();&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Create two child classes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  class vehicle{&lt;br /&gt;
      var $brand_name;&lt;br /&gt;
      var $number_of_wheels;&lt;br /&gt;
      var $seating_capacity;&lt;br /&gt;
  }&lt;br /&gt;
  class car extends vehicle {&lt;br /&gt;
      var $doors;&lt;br /&gt;
      var $prooftype;&lt;br /&gt;
      var $powersteering;&lt;br /&gt;
      var $powerwindows;&lt;br /&gt;
  }&lt;br /&gt;
  class motorbike extends vehicle {&lt;br /&gt;
      var $engine;&lt;br /&gt;
  }&lt;br /&gt;
  $merk= new car;&lt;br /&gt;
  $dukat=new motorbike;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Improved Inheritance: call parent constructor==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
     class shape&lt;br /&gt;
     {&lt;br /&gt;
          var $x;&lt;br /&gt;
          var $y;&lt;br /&gt;
   &lt;br /&gt;
          function shape($x, $y)  {&lt;br /&gt;
               $this-&amp;gt;move_to($x, $y);&lt;br /&gt;
               print(&amp;quot;Shape constructor called &amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
          }&lt;br /&gt;
          function get_x()  {&lt;br /&gt;
               return $this-&amp;gt;x;&lt;br /&gt;
          }&lt;br /&gt;
          function get_y()  {&lt;br /&gt;
               return $this-&amp;gt;y;&lt;br /&gt;
          }&lt;br /&gt;
          function set_x($x)  {&lt;br /&gt;
               $this-&amp;gt;x = $x;&lt;br /&gt;
          }&lt;br /&gt;
          function set_y($y)  {&lt;br /&gt;
               $this-&amp;gt;y = $y;&lt;br /&gt;
          }&lt;br /&gt;
          function move_to($x, $y)  {&lt;br /&gt;
               $this-&amp;gt;x = $x;&lt;br /&gt;
               $this-&amp;gt;y = $y;&lt;br /&gt;
          }&lt;br /&gt;
          function print_data()  {&lt;br /&gt;
               print(&amp;quot;Shape is currently at &amp;quot; . $this-&amp;gt;get_x() . &amp;quot;:&amp;quot; .&lt;br /&gt;
                                                $this-&amp;gt;get_y() . &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
          }&lt;br /&gt;
          function draw()&lt;br /&gt;
          {}&lt;br /&gt;
     }&lt;br /&gt;
     class rectangle extends shape&lt;br /&gt;
     {&lt;br /&gt;
          function rectangle($x, $y)  {&lt;br /&gt;
               parent::shape($x, $y);&lt;br /&gt;
          }&lt;br /&gt;
          function draw()  {&lt;br /&gt;
               print(&amp;quot;Drawing rectangle at &amp;quot; . $this-&amp;gt;x . &amp;quot;:&amp;quot; .&lt;br /&gt;
                                               $this-&amp;gt;y . &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
          }&lt;br /&gt;
          function print_data()  {&lt;br /&gt;
               print(&amp;quot;Rectangle currently at &amp;quot; . $this-&amp;gt;get_x() . &amp;quot;:&amp;quot; .&lt;br /&gt;
                                                 $this-&amp;gt;get_y() . &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
          }&lt;br /&gt;
     }&lt;br /&gt;
     $rect1 = new rectangle(100, 100);&lt;br /&gt;
     $rect1-&amp;gt;draw();&lt;br /&gt;
     $rect1-&amp;gt;print_data();&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Inheriting a Shape Class==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
     class shape {&lt;br /&gt;
          var $x;&lt;br /&gt;
          var $y;&lt;br /&gt;
   &lt;br /&gt;
          function shape()  {&lt;br /&gt;
               print(&amp;quot;Shape constructor called &amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
          }&lt;br /&gt;
          function get_x()  {&lt;br /&gt;
               return $this-&amp;gt;x;&lt;br /&gt;
          }&lt;br /&gt;
          function get_y()  {&lt;br /&gt;
               return $this-&amp;gt;y;&lt;br /&gt;
          }&lt;br /&gt;
          function set_x($x)  {&lt;br /&gt;
               $this-&amp;gt;x = $x;&lt;br /&gt;
          }&lt;br /&gt;
          function set_y($y)  {&lt;br /&gt;
               $this-&amp;gt;y = $y;&lt;br /&gt;
          }&lt;br /&gt;
          function move_to($x, $y)  {&lt;br /&gt;
               $this-&amp;gt;x = $x;&lt;br /&gt;
               $this-&amp;gt;y = $y;&lt;br /&gt;
          }&lt;br /&gt;
          function print_data()  {&lt;br /&gt;
               print(&amp;quot;Shape is currently at &amp;quot; . $this-&amp;gt;get_x() . &amp;quot;:&amp;quot; .&lt;br /&gt;
                                                $this-&amp;gt;get_y() . &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
          }&lt;br /&gt;
          function draw()&lt;br /&gt;
          {}&lt;br /&gt;
     }&lt;br /&gt;
     class rectangle extends shape&lt;br /&gt;
     {&lt;br /&gt;
          function rectangle($x, $y)  {&lt;br /&gt;
               $this-&amp;gt;move_to($x, $y);&lt;br /&gt;
          }&lt;br /&gt;
          function draw()  {&lt;br /&gt;
               print(&amp;quot;Drawing rectangle at &amp;quot; . $this-&amp;gt;x . &amp;quot;:&amp;quot; .&lt;br /&gt;
                                               $this-&amp;gt;y . &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
          }&lt;br /&gt;
          function print_data()  {&lt;br /&gt;
               print(&amp;quot;Rectangle currently at &amp;quot; . $this-&amp;gt;get_x() . &amp;quot;:&amp;quot; .&lt;br /&gt;
                                                 $this-&amp;gt;get_y() . &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
          }&lt;br /&gt;
     }&lt;br /&gt;
     &lt;br /&gt;
     &lt;br /&gt;
     $rect1 = new rectangle(100, 100);&lt;br /&gt;
     $rect1-&amp;gt;draw();&lt;br /&gt;
     $rect1-&amp;gt;print_data();&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>