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.
  • If you found this article useful, you should subscribe to my feed (or get an e-mail). I'm also on Twitter and GitHub.
  • About the Author

    Zach Leatherman is a Professional Front End Engineer. He loves building for the web, and has been contributing to the community through his blog since February 2007. Despite his propensity for software, he has a Bachelors degree in Computer Engineering and is currently on the User Experience Team at Union Pacific Railroad. The views expressed on this website do not represent the views of his employer.

    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, and one or more tarantulas. Read more »