www.webdeveloper.com
Results 1 to 4 of 4

Thread: Fun with PHP

  1. #1
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,518

    Fun with PHP

    Silliness that passed the last quarter hour of work today:
    PHP Code:
    <?php
    class foo {
        public function 
    foo(&$foo) {
            
    $foo create_function(
                
    '$foo',
                
    'echo "Hello, $foo.";'
            
    );
        }
    }
    new 
    foo($foo);
    $foo('foo');
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,518
    version 1.1:
    PHP Code:
    <?php
    class foo {
        private function 
    __construct() {}
        public static function 
    foo(&$foo) {
            
    $foo create_function('$foo','echo "Hello, $foo.";');
        }
    }
    foo::foo($foo);$foo('foo');
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,518
    And for another layer of absurdity:

    /foo:
    PHP Code:
     <?php
    class foo {
        private function 
    __construct() {}
        public static function 
    foo(&$foo) {
            
    $foo create_function('$foo','echo "Hello, $foo.";');
        }
    }
    /foo.php:
    PHP Code:
    require 'foo';foo::foo($foo);$foo('foo'); 
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    May 2013
    Posts
    5
    lol glad you had fun

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles