summaryrefslogtreecommitdiff
path: root/tests/code/interface.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-03-12 07:16:23 +0200
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-03-12 07:16:23 +0200
commit7076343338ae3439f3c86f01144818abe8c31978 (patch)
tree794abb1e6b8f821091fd095341885496b6dad51d /tests/code/interface.php
parent47cbb529f5723b246125ae083a193e11481b89ef (diff)
downloadclassroom-7076343338ae3439f3c86f01144818abe8c31978.tar.gz
classroom-7076343338ae3439f3c86f01144818abe8c31978.tar.bz2
classroom-7076343338ae3439f3c86f01144818abe8c31978.zip
add container helpers; constuct public directory-tree
Diffstat (limited to 'tests/code/interface.php')
-rw-r--r--tests/code/interface.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/code/interface.php b/tests/code/interface.php
new file mode 100644
index 0000000..3a06718
--- /dev/null
+++ b/tests/code/interface.php
@@ -0,0 +1,31 @@
+<?php
+
+interface moving
+{
+ public function go();
+}
+
+class walking implements moving
+{
+ public function go() { echo 'i walk'; }
+}
+
+class driving implements moving
+{
+ public function go() { echo 'i drive my car'; }
+}
+
+
+class flying implements moving
+{
+ public function go() { echo 'i got my airplane tickets'; }
+}
+
+
+// $driver = DRIVER;
+// $ready = new $driver();
+
+define('DRIVER', 'flying');
+$ready = new (DRIVER)();
+
+$ready->go();