Last active
December 30, 2015 21:25
-
-
Save gabrieljmj/686f41aeaf99516d3b83 to your computer and use it in GitHub Desktop.
Revisions
-
gabrieljmj revised this gist
Dec 30, 2015 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -20,5 +20,4 @@ private function getName($name) } } echo (new PhpOo)->callUserFuncArray('strlen', ['Hello']); -
gabrieljmj revised this gist
Dec 30, 2015 . No changes.There are no files selected for viewing
-
gabrieljmj renamed this gist
Dec 30, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ <?php class PhpOo { public function __call($name, array $args) { @@ -20,5 +20,5 @@ private function getName($name) } } $php = new PhpOo; echo $php->callUserFuncArray('strlen', ['Hello']); -
gabrieljmj revised this gist
Dec 30, 2015 . 1 changed file with 14 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,9 +4,21 @@ class PhpVanilla { public function __call($name, array $args) { $cUFA = $this->getName('callUserFuncArray'); return $cUFA($this->getName($name), $args); } private function getName($name) { foreach (str_split($name) as $l) { if (ctype_upper($l)) { $name = str_replace($l, '_' . strtolower($l), $name); } } return $name; } } $php = new PhpVanilla; echo $php->callUserFuncArray('strlen', ['Hello']); -
gabrieljmj created this gist
Dec 30, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ <?php class PhpVanilla { public function __call($name, array $args) { return call_user_func_array($name, $args); } } $php = new PhpVanilla; echo $php->strlen('Hello');