Skip to content

Commit

Permalink
Fixes zendframework#345 - CallbackHandler throws warning if WeakRef-e…
Browse files Browse the repository at this point in the history
…xtension not installed
  • Loading branch information
froschdesign authored and Dimitris Giotas committed Jun 17, 2016
1 parent 2339b43 commit 0ac8704
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/Zend/Stdlib/CallbackHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ protected function registerCallback($callback)
}

// If pecl/weakref is not installed, simply store the callback and return
if (!class_exists('WeakRef')) {
set_error_handler(array($this, 'errorHandler'), E_WARNING);
$callable = class_exists('WeakRef');
restore_error_handler();
if (!$callable || $this->error) {
$this->callback = $callback;
return;
}
Expand Down

0 comments on commit 0ac8704

Please sign in to comment.