Last commit went abit too quickly, this also adds example usage of multiple inheritance + fixes example from last commit

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@264648 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Kalle Sommer Nielsen 2008-08-11 22:23:57 +00:00
parent 2e5dc81daa
commit 6b23e41b5f

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<sect1 xml:id="language.oop5.interfaces" xmlns="http://docbook.org/ns/docbook">
<title>Object Interfaces</title>
<para>
@ -44,6 +44,7 @@
<programlisting role="php">
<![CDATA[
<?php
// Declare the interface 'iTemplate'
interface iTemplate
{
@ -84,7 +85,6 @@ class BadTemplate implements iTemplate
$this->vars[$name] = $var;
}
}
?>
]]>
</programlisting>
@ -93,6 +93,7 @@ class BadTemplate implements iTemplate
<title>Extendable Interfaces</title>
<programlisting role="php">
<![CDATA[
<?php
interface a
{
public function foo();
@ -126,6 +127,45 @@ class d implements b
{
}
}
?>
]]>
</programlisting>
</example>
<example xml:id="language.oop5.interfaces.examples.ex3">
<title>Multiple interface inheritance</title>
<programlisting role="php">
<![CDATA[
interface a
{
public function foo();
}
interface b
{
public function bar();
}
interface c extends a, b
{
public function baz();
}
class d implements c
{
public function foo()
{
}
public function bar()
{
}
public function baz()
{
}
}
]]>
</programlisting>
</example>