Skip to content

Instantly share code, notes, and snippets.

@wowo
Created November 11, 2010 16:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wowo/672716 to your computer and use it in GitHub Desktop.
Save wowo/672716 to your computer and use it in GitHub Desktop.
Weirdest PHP construction I've ever seen. From http://blog.sznapka.pl/weirdest-php-construction-ive-ever-seen/
<?php
class myClass
{
public function myPublicMethod()
{
function uglyFunction()
{
echo "le fu-";
}
}
}
$myObject = new myClass();
$myObject->myPublicMethod().uglyFunction(); // prints "le fu-"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment