Created
May 23, 2013 21:24
-
-
Save Firehed/5639541 to your computer and use it in GitHub Desktop.
triggers E_ERROR: "Cannot call overloaded function for non-object" on line 13
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 | |
private function getKey() { | |
if ($this->foo) { | |
$config = get_config(); | |
if (!isset($config['func']) || !is_callable($config['func'])) { | |
throw new Exception("Function missing") | |
} | |
$func = $config['func']; | |
} | |
else { | |
$func = function(model $m) { /* do some stuff */ }; | |
} | |
return $func($this->m); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the closure on line 11 has the same signature as the callable returned in the config and set on line 8, of course.