Created
February 7, 2014 01:38
-
-
Save andyfriesen/8856030 to your computer and use it in GitHub Desktop.
PHP and function indirection
This file contains 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 C { | |
public function call_private_function($f) { | |
return $f(); | |
} | |
private function run() { | |
echo "run!\n"; | |
} | |
} | |
$c = new C; | |
$c->call_private_function(array($c, 'run')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment