blob: 3f6c3f74913849546482a774a4389a6f39a6974c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<?php
/* interface contains only fixed-name declarations/stubs in with no access levels, yet it allows public,
* no ctors, no data members, no method definitions, no restriction on who implements this interface
*
*/
interface iDB {
const MAX_RECORDS = 5000;
public function query();
public function drop();
}
class MyDBDriver implements iDB {
public function query() {
echo "querying" . PHP_EOL;
}
public function drop() {
echo "dropping" . PHP_EOL;
}
}
$db = new MyDBDriver();
$db->query() . PHP_EOL;
$db = NULL;
|