diff options
Diffstat (limited to 'tests/code/interface.php')
| -rw-r--r-- | tests/code/interface.php | 31 |
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(); |
