Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function enhancedEcho () {
- echo implode("<br/>", func_get_args());
- }
- /**
- * Created by PhpStorm.
- * User: Thomas
- * Date: 4/22/2018
- * Time: 9:31 PM
- */
- interface MyApiInterface {
- public static function setName (string $name);
- }
- class Primate implements MyApiInterface {
- protected static $staticName = "Not so badass mofo";
- /**
- * @param string $name
- */
- public static function setName(string $name) {
- self::$staticName = $name;
- }
- }
- class Animal extends Primate {
- protected $name = '';
- function __construct(string $name) {
- $this->name = $name;
- }
- }
- class Dog extends Animal {
- function bark() {
- echo $this->name;
- }
- static function barkSoftly() {
- echo self::$staticName;
- }
- }
- $inst = new Dog("Some badass mofo");
- $inst->bark();
- echo "<br/>";
- enhancedEcho("Mememachine", "Secondmememachine");
- echo "<br/>";
- Dog::barkSoftly();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement