Created
October 14, 2018 10:55
-
-
Save Shaked/11fd39eb81f87e281c0b13482405abb8 to your computer and use it in GitHub Desktop.
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 A { | |
/** | |
* @param $args | |
*/ | |
public function methodIsCool($args) { | |
var_dump($args); | |
} | |
} | |
$userRequest = $_GET['userRequest'] ?? null; | |
$method = $userRequest . 'IsCool'; | |
$args = []; | |
$a = new A(); | |
if (method_exists($a, $method)) { | |
$a->$method($args); | |
} else { | |
var_dump('err: ' . $method); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment