Skip to content

Commit

Permalink
Callback::invokeSafe() workaround for HHVM bug facebook/hhvm#4625
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jul 1, 2015
1 parent 953866c commit f319c51
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Utils/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public static function invokeArgs($callable, array $args = [])
public static function invokeSafe($function, array $args, $onError)
{
$prev = set_error_handler(function ($severity, $message, $file) use ($onError, & $prev, $function) {
if ($file === '' && defined('HHVM_VERSION')) { // https://github.com/facebook/hhvm/issues/4625
$file = func_get_arg(5)[1]['file'];
}
if ($file === __FILE__ && $onError(str_replace("$function(): ", '', $message), $severity) !== FALSE) {
return;
} elseif ($prev) {
Expand Down

0 comments on commit f319c51

Please sign in to comment.