Skip to content

Instantly share code, notes, and snippets.

Created April 29, 2013 15:58
Show Gist options
  • Save anonymous/5482562 to your computer and use it in GitHub Desktop.
Save anonymous/5482562 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Apr 29, 2013.
    27 changes: 27 additions & 0 deletions hack.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    <?php

    class Foo {

    public function bar() {

    return "bar";
    }

    public static function baz() {

    return "baz";
    }
    }

    $foo = new Foo();

    $code = '
    echo $foo.bar();
    echo Foo::baz();
    ';

    $newcode = str_replace(".", "->", $code);

    eval($newcode);