mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
2e5dc81daa
commit
6b23e41b5f
1 changed files with 42 additions and 2 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue