Created
July 13, 2013 14:26
-
-
Save eteubert/5990894 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Foo { | |
| public function bar() { | |
| // ok | |
| $this->bar(); | |
| // nicht ok, weil $foo in einer anonymen Funktion steht und der Kontext der Klasse fehlt | |
| add_action('init', function() { | |
| $this->foo(); | |
| }) | |
| } | |
| public function foo() { | |
| echo 42; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment