Nursery Rhyme Code Poem [PHP]

< ?php
class I {
    public __construct()
    {
        $star = new Star();
        $star->size = 'little';
        $star->twinkle();
        $star->twinkle();
 
        self::wonder($star, 'What are you?');
 
        $world = new World();
        $world->elevation = 'So High';
        $star->setAbove($world);
 
        $d = new Diamond();
        $d->position = 'In the sky';
        $star->setLike($d);
 
        $star->twinkle();
        $star->twinkle();
        $star->size; // returns 'little'
 
        self::wonder($star, 'What are you?');
    }
 
    public static function wonder($obj, $query)
    {
        $obj->query($query);
    }
}

The above code poem is released under the BSD license. To use in production environment without error, please precede with the following command: error_reporting(0); Obviously I’m kidding, don’t use this code. Not even for enterprise software.

This entry was posted in Artistic, PHP and tagged , . Bookmark the permalink. Both comments and trackbacks are currently closed.
  • Hey! Use the magical power of RSS and Subscribe! Send me a tweet or a pull request!
  • Zach Leatherman is a Professional Front End Engineer. He loves building for the web and has been writing here since 2007. Feel free to stalk his résumé.

    He enjoys spending time with his beautiful wife Traci and their two Great Danes, Roxie and Ella. They also have a cat, a rabbit, goldfish, two poison dart frogs, and usually one or more tarantulas. Read more »